Commit 066b4a1c by Mark Mitchell Committed by Mark Mitchell

decl2.c (validate_nonmember_using_decl): Complain about using declarations for class members.

	* decl2.c (validate_nonmember_using_decl): Complain about using
	declarations for class members.

From-SVN: r24060
parent b7f7462b
1998-12-02 Mark Mitchell <mark@markmitchell.com>
* decl2.c (validate_nonmember_using_decl): Complain about using
declarations for class members.
1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (process_init_constructor): Use same_type_p.
......
......@@ -4690,6 +4690,16 @@ validate_nonmember_using_decl (decl, scope, name)
{
*scope = TREE_OPERAND (decl, 0);
*name = TREE_OPERAND (decl, 1);
/* [namespace.udecl]
A using-declaration for a class member shall be a
member-declaration. */
if (TREE_CODE (*scope) != NAMESPACE_DECL)
{
cp_error ("`%D' is not a namespace", *scope);
return NULL_TREE;
}
}
else if (TREE_CODE (decl) == IDENTIFIER_NODE
|| TREE_CODE (decl) == TYPE_DECL
......
// Build don't link:
class joey {
public:
typedef int SVec;
};
using joey::SVec; // ERROR - joey is not a namespace
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