Bug 50508 - [C++0x] ICE cxx_eval_logical_expression cp/semantics.c:6487
Summary: [C++0x] ICE cxx_eval_logical_expression cp/semantics.c:6487
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.1
: P3 normal
Target Milestone: 4.6.2
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-09-24 16:03 UTC by fuchsia.groan
Modified: 2011-09-27 02:23 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-09-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fuchsia.groan 2011-09-24 16:03:16 UTC
/* This ICEd the official mingw 4.6.1 with: 'internal compiler error: in cxx_eval_logical_expression at cp/semantics.c:6487'

(I had the same result on gcc 4.7.0 20110813 from www.equation.com)
*/
#include <type_traits>

static constexpr bool value = std::integral_constant<bool,true>()
                              && std::integral_constant<bool,true>();
Comment 1 Jonathan Wakely 2011-09-24 16:20:07 UTC
fails the gcc_assert in cxx_eval_logical_expression
Comment 2 Jonathan Wakely 2011-09-24 16:23:30 UTC
reduced

template <class T>
  struct integral_constant {
    typedef T value_type;
    constexpr operator value_type() { return true; }
  };


static constexpr bool value = integral_constant<bool>()
                              && true;
Comment 3 Jason Merrill 2011-09-27 02:12:46 UTC
Author: jason
Date: Tue Sep 27 02:12:42 2011
New Revision: 179228

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179228
Log:
	PR c++/50508
	* semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
	rather than ==.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Jason Merrill 2011-09-27 02:19:00 UTC
Author: jason
Date: Tue Sep 27 02:18:56 2011
New Revision: 179231

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179231
Log:
	PR c++/50508
	* semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
	rather than ==.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 5 Jason Merrill 2011-09-27 02:23:13 UTC
Fixed for 4.6.2.