This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/23841] New: [4.0/4.1 Regression] Floating-point literals cast to integral types should be accepted in integer constant expressions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]