Bug 48369 - [4.6 Regression] [C++0x] ICE in potential_constant_expression_1, at cp/semantics.c:7746
Summary: [4.6 Regression] [C++0x] ICE in potential_constant_expression_1, at cp/seman...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.1
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code
: 48577 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-30 16:03 UTC by Jonathan Wakely
Modified: 2011-04-12 17:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-03-30 18:44:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2011-03-30 16:03:05 UTC
extern "C" int isnan (double);

void f(double d)
{
    bool b = isnan(d);
}

$ ~/gcc/4.6/bin/g++ s.cc -std=gnu++0x
s.cc: In function 'void f(double)':
s.cc:5:21: sorry, unimplemented: unexpected ast of kind unordered_expr
s.cc:5:21: internal compiler error: in potential_constant_expression_1, at cp/semantics.c:7746
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Only happens when the function is extern "C" but that obviously affects the whole of <math.h>

No ICE for -std=c++98 / gnu++98 / c++0x, only gnu++0x

I haven't tried it on trunk
Comment 1 Jason Merrill 2011-03-30 19:50:22 UTC
Author: jason
Date: Wed Mar 30 19:50:17 2011
New Revision: 171746

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171746
Log:
	PR c++/48369
	* semantics.c (potential_constant_expression_1): Handle
	UNORDERED_EXPR and ORDERED_EXPR.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/regress/isnan.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 2 Jason Merrill 2011-03-30 19:51:40 UTC
Author: jason
Date: Wed Mar 30 19:51:32 2011
New Revision: 171747

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171747
Log:
	PR c++/48369
	* semantics.c (potential_constant_expression_1): Handle
	UNORDERED_EXPR and ORDERED_EXPR.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Jason Merrill 2011-03-30 19:52:10 UTC
Fixed for 4.6.1.
Comment 4 Paolo Carlini 2011-04-12 17:08:32 UTC
*** Bug 48577 has been marked as a duplicate of this bug. ***