diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-09-27 21:52:19 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-09-27 21:52:19 +0000 |
commit | 2427db200d7e56fda1cf034ca0d1cb2999b5b970 (patch) | |
tree | 223b7775cf09fa658f31f839b5f3885bcee2cc6b /gcc/cp | |
parent | 82aa87223192a954c5bee4fc5d7dadae0d120b7e (diff) | |
download | gcc-2427db200d7e56fda1cf034ca0d1cb2999b5b970.zip gcc-2427db200d7e56fda1cf034ca0d1cb2999b5b970.tar.gz gcc-2427db200d7e56fda1cf034ca0d1cb2999b5b970.tar.bz2 |
re PR c++/31489 (error says struct when it should say class)
/cp
2011-09-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/31489
* parser.c (cp_parser_elaborated_type_specifier): For RECORD_TYPE,
set CLASSTYPE_DECLARED_CLASS.
/testsuite
2011-09-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/31489
* g++.dg/parse/error40.C: New.
* g++.dg/warn/incomplete1.C: Adjust.
From-SVN: r179293
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24068c8..596d4a9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-27 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/31489 + * parser.c (cp_parser_elaborated_type_specifier): For RECORD_TYPE, + set CLASSTYPE_DECLARED_CLASS. + 2011-09-27 Jakub Jelinek <jakub@redhat.com> * decl.c (duplicate_decls): If compatible stpcpy prototype diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9600aa9..83d7b71 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13423,7 +13423,13 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, } if (tag_type != enum_type) - cp_parser_check_class_key (tag_type, type); + { + /* Indicate whether this class was declared as a `class' or as a + `struct'. */ + if (TREE_CODE (type) == RECORD_TYPE) + CLASSTYPE_DECLARED_CLASS (type) = (tag_type == class_type); + cp_parser_check_class_key (tag_type, type); + } /* A "<" cannot follow an elaborated type specifier. If that happens, the user was probably trying to form a template-id. */ |