Commit d7ed5e55 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

PR c++/9432, c++/9528

	PR c++/9432, c++/9528
	* decl2.c (validate_nonmember_using_decl): Handle SCOPE_REF.

	* g++.dg/lookup/using4.C: New test.

From-SVN: r66298
parent d1908feb
2003-04-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9432, c++/9528
* decl2.c (validate_nonmember_using_decl): Handle SCOPE_REF.
2003-04-30 Garbiel Dos Reis <gcc@integrable-solutions.net>
* decl.c (check_previous_goto_1): Adjust prototype.
......
......@@ -4236,6 +4236,14 @@ validate_nonmember_using_decl (tree decl, tree *scope, tree *name)
return NULL_TREE;
}
if (TREE_CODE (decl) == SCOPE_REF)
{
/* It's a nested name with template parameter dependent scope.
This can only be using-declaration for class member. */
error ("`%T' is not a namespace", TREE_OPERAND (decl, 0));
return NULL_TREE;
}
if (is_overloaded_fn (decl))
decl = get_first_fn (decl);
......
2003-04-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9432, c++/9528
* g++.dg/lookup/using4.C: New test.
2003-04-29 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/noreturn-5.c: New file.
......
// { dg-do compile }
// Origin: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
// PR c++/9432: ICE in validate_nonmember_using_decl when decl is a
// SCOPE_REF.
template <class T> struct Foo;
template <class T>
struct Bar : public Foo<T> {
void foo()
{
using Foo<T>::i; // { dg-error "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