re PR c++/17068 (ICE: tree check: expected class 'd', have 'x' (identifier_node)...
authorMark Mitchell <mark@codesourcery.com>
Wed, 18 Aug 2004 18:25:10 +0000 (18:25 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 18 Aug 2004 18:25:10 +0000 (18:25 +0000)
PR c++/17068
* pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
dependent.

PR c++/17068
* g++.dg/template/operator4.C: New test.

From-SVN: r86199

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/operator4.C [new file with mode: 0644]

index 1a97ccaeb493409f00b1c7fcb7acb542d1962359..0ba2415b4a45925f832e6f9187e1278af2ac8ef9 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-18  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17068
+       * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
+       dependent.
+
 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/16246
index 257f1066bb52abe4b1f522e9a73761945ee7cea2..5175eb1e7056ae86cd2daef2fed3cec52290d0a9 100644 (file)
@@ -12033,8 +12033,9 @@ dependent_template_p (tree tmpl)
   if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)
       || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM)
     return true;
-  /* So are qualified names that have not been looked up.  */
-  if (TREE_CODE (tmpl) == SCOPE_REF)
+  /* So arenames that have not been looked up.  */
+  if (TREE_CODE (tmpl) == SCOPE_REF
+      || TREE_CODE (tmpl) == IDENTIFIER_NODE)
     return true;
   /* So are member templates of dependent classes.  */
   if (TYPE_P (CP_DECL_CONTEXT (tmpl)))
index 78cd8dfecebe890cbafad91f9f02d987298443ac..c95d844cf599f7b687d15000af60c62ac854abee 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-18  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17068
+       * g++.dg/template/operator4.C: New test.
+
 2004-08-18  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/20040206-1.c: XFAIL.
diff --git a/gcc/testsuite/g++.dg/template/operator4.C b/gcc/testsuite/g++.dg/template/operator4.C
new file mode 100644 (file)
index 0000000..972d52f
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/17068
+
+struct A
+{
+  template<int> void operator()() {}
+};
+
+template<typename> void foo()
+{
+  A().template operator()<0>();
+}