This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH: PR 27102


This patch fixes fallout from my patch for PR c++/27102.  We can now
get a TYPENAME_TYPE in cxx_incomplete_type_diagnostic, so we need to
handle that case.  

Tested on x86_64-unknown-linux-gnu, applied to mainline.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

2006-04-27  Mark Mitchell  <mark@codesourcery.com>

	PR c++/27102
	* typeck2.c (cxx_incomplete_type_diagnostic): Handle
	TYPENAME_TYPE.

2006-04-27  Mark Mitchell  <mark@codesourcery.com>

	PR c++/27102
	* g++.dg/template/crash47.C: New test.

Index: gcc/cp/typeck2.c
===================================================================
--- gcc/cp/typeck2.c	(revision 113212)
+++ gcc/cp/typeck2.c	(working copy)
@@ -406,6 +406,10 @@ cxx_incomplete_type_diagnostic (tree val
       p_msg ("invalid use of template type parameter");
       break;
 
+    case TYPENAME_TYPE:
+      p_msg ("invalid use of dependent type %qT", type);
+      break;
+
     case UNKNOWN_TYPE:
       if (value && TREE_CODE (value) == COMPONENT_REF)
 	goto bad_member;
Index: gcc/testsuite/g++.dg/template/crash47.C
===================================================================
--- gcc/testsuite/g++.dg/template/crash47.C	(revision 0)
+++ gcc/testsuite/g++.dg/template/crash47.C	(revision 0)
@@ -0,0 +1,3 @@
+// PR c++/27102
+
+template<typename T> void T::X::foo() {} // { dg-error "invalid" }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]