re PR c++/37877 (Invalid "invalid use of static" error)
PR c++/37877 * parser.c (cp_parser_class_specifier): Clear parser->in_unbraced_linkage_specification_p while parsing class specifiers. * g++.dg/parse/linkage3.C: New test. From-SVN: r143206
This commit is contained in:
parent
91c82473ac
commit
73f971b716
@ -1,3 +1,10 @@
|
||||
2009-01-09 John F. Carr <jfc@mit.edu>
|
||||
|
||||
PR c++/37877
|
||||
* parser.c (cp_parser_class_specifier): Clear
|
||||
parser->in_unbraced_linkage_specification_p while parsing class
|
||||
specifiers.
|
||||
|
||||
2009-01-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/38725
|
||||
|
@ -14873,6 +14873,7 @@ cp_parser_class_specifier (cp_parser* parser)
|
||||
bool nested_name_specifier_p;
|
||||
unsigned saved_num_template_parameter_lists;
|
||||
bool saved_in_function_body;
|
||||
bool saved_in_unbraced_linkage_specification_p;
|
||||
tree old_scope = NULL_TREE;
|
||||
tree scope = NULL_TREE;
|
||||
tree bases;
|
||||
@ -14924,6 +14925,10 @@ cp_parser_class_specifier (cp_parser* parser)
|
||||
/* We are not in a function body. */
|
||||
saved_in_function_body = parser->in_function_body;
|
||||
parser->in_function_body = false;
|
||||
/* We are not immediately inside an extern "lang" block. */
|
||||
saved_in_unbraced_linkage_specification_p
|
||||
= parser->in_unbraced_linkage_specification_p;
|
||||
parser->in_unbraced_linkage_specification_p = false;
|
||||
|
||||
/* Start the class. */
|
||||
if (nested_name_specifier_p)
|
||||
@ -15036,6 +15041,8 @@ cp_parser_class_specifier (cp_parser* parser)
|
||||
parser->in_function_body = saved_in_function_body;
|
||||
parser->num_template_parameter_lists
|
||||
= saved_num_template_parameter_lists;
|
||||
parser->in_unbraced_linkage_specification_p
|
||||
= saved_in_unbraced_linkage_specification_p;
|
||||
|
||||
return type;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-01-09 John F. Carr <jfc@mit.edu>
|
||||
|
||||
PR c++/37877
|
||||
* g++.dg/parse/linkage3.C: New test.
|
||||
|
||||
2009-01-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/38771
|
||||
|
7
gcc/testsuite/g++.dg/parse/linkage3.C
Normal file
7
gcc/testsuite/g++.dg/parse/linkage3.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/37877
|
||||
// { dg-do compile }
|
||||
|
||||
extern "C++" struct S
|
||||
{
|
||||
static int x;
|
||||
} s;
|
Loading…
Reference in New Issue
Block a user