+2007-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/30536
+ * decl.c (grokdeclarator): If __thread is used together with
+ a storage class other than extern and static, clear thread_p
+ after issuing diagnostics and fall through to checking the
+ storage class.
+
2007-01-30 Roger Sayle <roger@eyesopen.com>
* error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
/* Warn about storage classes that are invalid for certain
kinds of declarations (parameters, typenames, etc.). */
+ if (thread_p
+ && ((storage_class
+ && storage_class != sc_extern
+ && storage_class != sc_static)
+ || declspecs->specs[(int)ds_typedef]))
+ {
+ error ("multiple storage classes in declaration of %qs", name);
+ thread_p = false;
+ }
if (declspecs->conflicting_specifiers_p)
{
error ("conflicting specifiers in declaration of %qs", name);
storage_class = sc_none;
}
- else if (thread_p
- && ((storage_class
- && storage_class != sc_extern
- && storage_class != sc_static)
- || declspecs->specs[(int)ds_typedef]))
- {
- error ("multiple storage classes in declaration of %qs", name);
- thread_p = false;
- }
else if (decl_context != NORMAL
&& ((storage_class != sc_none
&& storage_class != sc_mutable)
2007-02-02 Jakub Jelinek <jakub@redhat.com>
+ PR c++/30536
+ * g++.dg/tls/diag-5.C: New test.
+
PR middle-end/30473
* gcc.dg/pr30473.c: New test.
* gcc.c-torture/execute/20070201-1.c: New test.
--- /dev/null
+// PR c++/30536
+// Invalid __thread specifiers.
+// { dg-require-effective-target tls }
+
+struct A { __thread register int i; }; // { dg-error "multiple storage classes|storage class specified" }