re PR c++/10554 (ICE with illegal using declaration)
PR c++/10554 * decl2.c (do_class_using_decl): Check if operand 0 of SCOPE_REF is not NULL. * g++.dg/lookup/using5.C: New test. From-SVN: r66329
This commit is contained in:
parent
85209a3c3b
commit
d0af00afb9
@ -1,3 +1,9 @@
|
||||
2003-05-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/10554
|
||||
* decl2.c (do_class_using_decl): Check if operand 0 of SCOPE_REF
|
||||
is not NULL.
|
||||
|
||||
2003-05-01 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* cp-tree.h (struct lang_id2): Remove. Move fields from here...
|
||||
|
@ -4458,6 +4458,7 @@ do_class_using_decl (tree decl)
|
||||
tree name, value;
|
||||
|
||||
if (TREE_CODE (decl) != SCOPE_REF
|
||||
|| !TREE_OPERAND (decl, 0)
|
||||
|| !TYPE_P (TREE_OPERAND (decl, 0)))
|
||||
{
|
||||
error ("using-declaration for non-member at class scope");
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-05-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/10554
|
||||
* g++.dg/lookup/using5.C: New test.
|
||||
|
||||
2003-05-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/8772
|
||||
|
17
gcc/testsuite/g++.dg/lookup/using5.C
Normal file
17
gcc/testsuite/g++.dg/lookup/using5.C
Normal file
@ -0,0 +1,17 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
// PR c++/10554: ICE for member using declaration with failed
|
||||
// scope name lookup.
|
||||
|
||||
template <typename> struct A
|
||||
{
|
||||
typedef A X;
|
||||
void foo();
|
||||
};
|
||||
|
||||
template <typename T> struct B : A<T>
|
||||
{
|
||||
using X::foo; { dg-error "not a class-name|expected|non-member" }
|
||||
};
|
Loading…
Reference in New Issue
Block a user