Commit d9a50301 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent b6d83931
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);
......
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.
......
// { 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" }
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