Commit 76543000 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

* decl2.c (validate_nonmember_using_decl): Handle NAMESPACE_DECL.

From-SVN: r46565
parent 7dddfb65
2001-10-27 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* decl2.c (validate_nonmember_using_decl): Handle NAMESPACE_DECL.
2001-10-25 Zack Weinberg <zack@codesourcery.com> 2001-10-25 Zack Weinberg <zack@codesourcery.com>
* cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to * cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to
......
...@@ -4877,6 +4877,11 @@ validate_nonmember_using_decl (decl, scope, name) ...@@ -4877,6 +4877,11 @@ validate_nonmember_using_decl (decl, scope, name)
*scope = global_namespace; *scope = global_namespace;
*name = decl; *name = decl;
} }
else if (TREE_CODE (decl) == NAMESPACE_DECL)
{
cp_error ("namespace `%D' not allowed in using-declaration", decl);
return NULL_TREE;
}
else else
my_friendly_abort (382); my_friendly_abort (382);
if (DECL_P (*name)) if (DECL_P (*name))
......
...@@ -25,6 +25,8 @@ namespace N ...@@ -25,6 +25,8 @@ namespace N
template<int> void f() {} template<int> void f() {}
} }
using N; // { dg-error "parse error" "" }
using ::N; // { dg-error "using-declaration" "" }
using N::f< 0 >; // { dg-error "using-declaration" "" } using N::f< 0 >; // { dg-error "using-declaration" "" }
struct A { struct A {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment