diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-09-23 16:19:52 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-09-23 16:19:52 +0000 |
commit | d45510814279358307e46c435716843819c6460b (patch) | |
tree | d51a1328ea7cd927a6f8cb46821821d3c0215fb9 /gcc/cp/decl.c | |
parent | 6172a2f298b613bcfbaab9fd4469780a63acfeb4 (diff) | |
download | gcc-d45510814279358307e46c435716843819c6460b.zip gcc-d45510814279358307e46c435716843819c6460b.tar.gz gcc-d45510814279358307e46c435716843819c6460b.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 86fd2d5..709deca 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); |