1998-08-12 Mark Mitchell <mark@markmitchell.com>
* decl.c (grokdeclarator): Issue errors on namespace qualified
declarators in parameter lists or in class scope.
From-SVN: r21684
+1998-08-12 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokdeclarator): Issue errors on namespace qualified
+ declarators in parameter lists or in class scope.
+
1998-08-09 Mark Mitchell <mark@markmitchell.com>
* pt.c (check_explicit_specialization): Don't abort on bogus
if (decl_context == PARM)
{
- if (ctype)
+ if (ctype || in_namespace)
error ("cannot use `::' in parameter declaration");
/* A parameter declared as an array of T is really a pointer to T.
are error_mark_node, for example. */
decl = NULL_TREE;
}
+ else if (in_namespace)
+ {
+ /* Something like struct S { int N::j; }; */
+ cp_error ("invalid use of `::'");
+ decl = NULL_TREE;
+ }
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
int publicp = 0;
--- /dev/null
+// Build don't link:
+
+namespace N {}
+
+void f(int N::k); // ERROR - cannot use `::' in parameter declaration
+
+class Foo
+{
+ int N::j; // ERROR - invalid use of `::'
+};