+2006-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28056
+ * decl.c (grokdeclarator): Disallow declarations with qualified
+ names in local scopes.
+
2006-08-25 Nathan Sidwell <nathan@codesourcery.com>
PR c++/27787
break;
if (qualifying_scope)
{
- if (TYPE_P (qualifying_scope))
+ if (at_function_scope_p ())
+ {
+ /* [dcl.meaning]
+
+ A declarator-id shall not be qualified except
+ for ...
+
+ None of the cases are permitted in block
+ scope. */
+ if (qualifying_scope == global_namespace)
+ error ("invalid use of qualified-name %<::%D%>",
+ decl);
+ else if (TYPE_P (qualifying_scope))
+ error ("invalid use of qualified-name %<%T::%D%>",
+ qualifying_scope, decl);
+ else
+ error ("invalid use of qualified-name %<%D::%D%>",
+ qualifying_scope, decl);
+ return error_mark_node;
+ }
+ else if (TYPE_P (qualifying_scope))
{
ctype = qualifying_scope;
if (innermost_code != cdk_function
--- /dev/null
+// PR c++/28056
+
+void f1();
+
+namespace N {
+ void f2();
+}
+
+class C {
+ static void f3();
+};
+
+void foo() {
+ void ::f1(); // { dg-error "qualified" }
+ void N::f2(); // { dg-error "qualified" }
+ void C::f3(); // { dg-error "qualified" }
+ void ::f4(); // { dg-error "qualified" }
+}