Commit d4551081 by Paolo Carlini Committed by Paolo Carlini

re PR c++/50258 ([C++0x] -std=gnu++0x should allow in-class initialization of…

re PR c++/50258 ([C++0x] -std=gnu++0x should allow in-class initialization of static const floating types without constexpr)

/cp
2011-09-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50258
	* decl.c (check_static_variable_definition): Allow in-class
	initialization of static data member of non-integral type in
	permissive mode.

/testsuite
2011-09-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50258
	* g++.dg/cpp0x/constexpr-static8.C: New.

From-SVN: r179121
parent 6172a2f2
2011-09-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50258
* decl.c (check_static_variable_definition): Allow in-class
initialization of static data member of non-integral type in
permissive mode.
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50491
......
......@@ -7716,8 +7716,9 @@ check_static_variable_definition (tree decl, tree type)
else if (cxx_dialect >= cxx0x && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
if (literal_type_p (type))
error ("%<constexpr%> needed for in-class initialization of static "
"data member %q#D of non-integral type", decl);
permerror (input_location,
"%<constexpr%> needed for in-class initialization of "
"static data member %q#D of non-integral type", decl);
else
error ("in-class initialization of static data member %q#D of "
"non-literal type", decl);
......
2011-09-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50258
* g++.dg/cpp0x/constexpr-static8.C: New.
2011-09-23 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/avxfp-1.c: New test.
......
// PR c++/50258
// { dg-options "-std=c++0x -fpermissive" }
struct Foo {
static const double d = 3.14; // { dg-warning "constexpr" }
};
const double Foo::d; // { dg-warning "constexpr" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment