re PR c++/11076 (ICE with invalid base class)
PR c++/11076 * class.c (handle_using_decl): Swap arguments of error_not_base_type. * parser.c (cp_parser_direct_declarator): Only resolve typename for namespace scope declarations. * g++.dg/template/crash13.C: New test. From-SVN: r72897
This commit is contained in:
parent
b6d8393123
commit
d9a5030180
|
@ -1,3 +1,10 @@
|
|||
2003-10-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/11076
|
||||
* class.c (handle_using_decl): Swap arguments of error_not_base_type.
|
||||
* parser.c (cp_parser_direct_declarator): Only resolve typename for
|
||||
namespace scope declarations.
|
||||
|
||||
2003-10-24 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/12698, c++/12699, c++/12700, c++/12566
|
||||
|
|
|
@ -1109,7 +1109,7 @@ handle_using_decl (tree using_decl, tree t)
|
|||
binfo = lookup_base (t, ctype, ba_any, NULL);
|
||||
if (! binfo)
|
||||
{
|
||||
error_not_base_type (t, ctype);
|
||||
error_not_base_type (ctype, t);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9871,7 +9871,8 @@ cp_parser_direct_declarator (cp_parser* parser,
|
|||
if (declarator == error_mark_node)
|
||||
break;
|
||||
|
||||
if (TREE_CODE (declarator) == SCOPE_REF)
|
||||
if (TREE_CODE (declarator) == SCOPE_REF
|
||||
&& !current_scope ())
|
||||
{
|
||||
tree scope = TREE_OPERAND (declarator, 0);
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2003-10-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/11076
|
||||
* g++.dg/template/crash13.C: New test.
|
||||
|
||||
2003-10-24 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
* gcc.dg/c99-restrict-2.c: New test.
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// { dg-do compile }
|
||||
|
||||
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
|
||||
|
||||
// PR c++/11076: ICE for invalid access declaration containing typename.
|
||||
|
||||
template<typename, typename T=void> struct A
|
||||
{
|
||||
typedef A<T,T> B;
|
||||
};
|
||||
|
||||
template <typename T> struct C
|
||||
{ // { dg-error "not a base type" }
|
||||
typedef typename A<T>::B X;
|
||||
X::Y;
|
||||
};
|
||||
|
||||
C<void> c; // { dg-error "instantiated" }
|
Loading…
Reference in New Issue