mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-06 02:20:34 +08:00
re PR c++/26571 (Bad diagnostic using type modifier with struct)
PR c++/26571 * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case where the name is a type used incorrectly. From-SVN: r116715
This commit is contained in:
parent
a1a9524971
commit
5df1740de4
@ -1,5 +1,9 @@
|
||||
2006-09-05 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/26571
|
||||
* parser.c (cp_parser_diagnose_invalid_type_name): Handle the case
|
||||
where the name is a type used incorrectly.
|
||||
|
||||
PR c++/26671
|
||||
* typeck.c (maybe_warn_about_returning_address_of_local): Look
|
||||
through COMPONENT_REF and ARRAY_REF.
|
||||
|
@ -2101,6 +2101,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id)
|
||||
error ("invalid use of template-name %qE without an argument list", decl);
|
||||
else if (TREE_CODE (id) == BIT_NOT_EXPR)
|
||||
error ("invalid use of destructor %qD as a type", id);
|
||||
else if (TREE_CODE (decl) == TYPE_DECL)
|
||||
/* Something like 'unsigned A a;' */
|
||||
error ("invalid combination of multiple type-specifiers");
|
||||
else if (!parser->scope)
|
||||
{
|
||||
/* Issue an error message. */
|
||||
|
4
gcc/testsuite/g++.dg/parse/typespec1.C
Normal file
4
gcc/testsuite/g++.dg/parse/typespec1.C
Normal file
@ -0,0 +1,4 @@
|
||||
// PR c++/26571
|
||||
|
||||
struct A {};
|
||||
unsigned A a; // { dg-error "multiple" }
|
Loading…
x
Reference in New Issue
Block a user