PRs C++/6803, C++/7721 and C++/7803
* decl.c (grokdeclarator): Gracefully handle template-name as
decl-specifier.
From-SVN: r58054
+2002-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PRs C++/6803, C++/7721 and C++/7803
+ * decl.c (grokdeclarator): Gracefully handle template-name as
+ decl-specifier.
+
2002-10-09 Zack Weinberg <zack@codesourcery.com>
PR c/7353
next = 0;
break;
+ case TEMPLATE_DECL:
+ /* Sometimes, we see a template-name used as part of a
+ decl-specifier like in
+ std::allocator alloc;
+ Handle that gracefully. */
+ error ("invalid use of template-name '%E' as type-specifier",
+ decl);
+ return error_mark_node;
+ break;
+
default:
internal_error ("`%D' as declarator", decl);
}
--- /dev/null
+// Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+// Origin: PRs 7721 and 7803
+// { dg-do compile }
+
+namespace N
+{
+ template<typename>
+ struct X { };
+}
+
+N::X X; // { dg-error "" "" }
+
+int main()
+{
+ return sizeof(X); // { dg-error "" "" }
+}