diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-10-29 15:20:10 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-10-29 15:20:10 +0000 |
commit | 5f546e16b7ebff030c8d8f933b99378ce2a271c8 (patch) | |
tree | 5b4ea0b9c44c8b813d9b7d20214ee330daa029f2 /gcc/cp | |
parent | 72a6cdded16108660cf4fd20b9195004768a4a5a (diff) | |
download | gcc-5f546e16b7ebff030c8d8f933b99378ce2a271c8.zip gcc-5f546e16b7ebff030c8d8f933b99378ce2a271c8.tar.gz gcc-5f546e16b7ebff030c8d8f933b99378ce2a271c8.tar.bz2 |
re PR c++/58888 ([c++11] Rejects-valid: static member with auto and initializer)
/cp
2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58888
* decl2.c (grokfield): Handle auto like NSDMI.
/testsuite
2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58888
* g++.dg/cpp0x/auto40.C: New.
* g++.dg/other/warning1.C: Adjust.
From-SVN: r204164
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 20 |
2 files changed, 5 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 297d015..99f14e0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-10-29 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58888 + * decl2.c (grokfield): Handle auto like NSDMI. + 2013-10-25 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58878 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 5e5f5e8..2668849 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -955,26 +955,6 @@ grokfield (const cp_declarator *declarator, /* C++11 NSDMI, keep going. */; else if (!VAR_P (value)) gcc_unreachable (); - else if (!processing_template_decl) - { - if (TREE_CODE (init) == CONSTRUCTOR) - init = digest_init (TREE_TYPE (value), init, tf_warning_or_error); - init = maybe_constant_init (init); - - if (init != error_mark_node && !TREE_CONSTANT (init)) - { - /* We can allow references to things that are effectively - static, since references are initialized with the - address. */ - if (TREE_CODE (TREE_TYPE (value)) != REFERENCE_TYPE - || (TREE_STATIC (init) == 0 - && (!DECL_P (init) || DECL_EXTERNAL (init) == 0))) - { - error ("field initializer is not constant"); - init = error_mark_node; - } - } - } } if (processing_template_decl && VAR_OR_FUNCTION_DECL_P (value)) |