+2004-06-24 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (grokdeclarator): Restore error messages about __thread.
+ * parser.c (cp_parser_decl_specifier_seq): Likewise.
+
2004-06-24 Jason Merrill <jason@redhat.com>
PR c++/16115
longlong = 1;
}
else if (declspecs->specs[(int)ds] > 1)
- error ("duplicate decl-specifier");
+ {
+ static const char *decl_spec_names[] = {
+ "signed",
+ "unsigned",
+ "short",
+ "long",
+ "const",
+ "volatile",
+ "restrict",
+ "inline",
+ "virtual",
+ "explicit",
+ "friend",
+ "typedef",
+ "__complex",
+ "__thread"
+ };
+ error ("duplicate `%s'", decl_spec_names[(int)ds]);
+ }
}
#if 0
kinds of declarations (parameters, typenames, etc.). */
if (declspecs->multiple_storage_classes_p)
error ("multiple storage classes in declaration of `%s'", name);
+ else if (declspecs->specs[(int)ds_thread]
+ && ((declspecs->storage_class
+ && declspecs->storage_class != sc_extern
+ && declspecs->storage_class != sc_static)
+ || declspecs->specs[(int)ds_typedef]))
+ {
+ error ("multiple storage classes in declaration of `%s'", name);
+ declspecs->specs[(int)ds_thread] = 0;
+ }
else if (decl_context != NORMAL
- && declspecs->storage_class != sc_none
- && declspecs->storage_class != sc_mutable)
+ && ((declspecs->storage_class != sc_none
+ && declspecs->storage_class != sc_mutable)
+ || declspecs->specs[(int)ds_thread]))
{
if ((decl_context == PARM || decl_context == CATCHPARM)
&& (declspecs->storage_class == sc_register
/* Consume the token. */
cp_lexer_consume_token (parser->lexer);
if (decl_specs->specs[(int) ds_thread])
- error ("`__thread' before `static'");
- else
- cp_parser_set_storage_class (decl_specs, sc_static);
+ {
+ error ("`__thread' before `static'");
+ decl_specs->specs[(int) ds_thread] = 0;
+ }
+ cp_parser_set_storage_class (decl_specs, sc_static);
break;
case RID_EXTERN:
/* Consume the token. */
cp_lexer_consume_token (parser->lexer);
if (decl_specs->specs[(int) ds_thread])
- error ("`__thread' before `extern'");
- else
- cp_parser_set_storage_class (decl_specs, sc_extern);
+ {
+ error ("`__thread' before `extern'");
+ decl_specs->specs[(int) ds_thread] = 0;
+ }
+ cp_parser_set_storage_class (decl_specs, sc_extern);
break;
case RID_MUTABLE:
/* Consume the token. */