This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23841] New: [4.0/4.1 Regression] Floating-point literals cast to integral types should be accepted in integer constant expressions
- From: "jsm28 at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2005 20:14:42 -0000
- Subject: [Bug c++/23841] New: [4.0/4.1 Regression] Floating-point literals cast to integral types should be accepted in integer constant expressions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
template <int I>
struct S
{
int f(int i = I) { return i; }
};
void
g ()
{
S<(int)0.> a2;
}
is valid code - floating-point literals immediately cast to integral types are
valid in integral constant expressions - but GCC (4.0/4.1) wrongly rejects it
with -ansi -pedantic-errors.
Mark has asked for this bug to be assigned to him.
--
Summary: [4.0/4.1 Regression] Floating-point literals cast to
integral types should be accepted in integer constant
expressions
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: mark at codesourcery dot com
ReportedBy: jsm28 at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23841