re PR c++/8385 (typeof(...) as template arg)
authorMark Mitchell <mark@codesourcery.com>
Thu, 15 May 2003 17:00:06 +0000 (17:00 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 15 May 2003 17:00:06 +0000 (17:00 +0000)
PR c++/8385
* g++.dg/ext/typeof5.C: New test.

PR c++/8385
* semantics.c (finish_typeof): Refine type-dependency check.

From-SVN: r66835

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/typeof5.C [new file with mode: 0644]

index f375a4f82051e63cb2d9c0768d1f15ebb73cd8eb..4c01679e46a8a215e28412d3e2a83f26144c60ba 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-15  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/8385
+       * semantics.c (finish_typeof): Refine type-dependency check.
+
 2003-05-13  Jason Merrill  <jason@redhat.com>
 
        * typeck.c (build_modify_expr): Don't always stabilize the lhs and
index ab6a75c7ddbca03d50afcd406023575ed29670df..082bc788f1e3b3c85a8233a7d402a1ce2a524e23 100644 (file)
@@ -2163,7 +2163,7 @@ finish_typeof (expr)
 {
   tree type;
 
-  if (processing_template_decl)
+  if (type_dependent_expression_p (expr))
     {
       type = make_aggr_type (TYPEOF_TYPE);
       TYPE_FIELDS (type) = expr;
index 2497dfd56e33888e6e52ef6d862810c038537e13..be7261e7824d8a6cb4ad7fcd1581612f8cedf59f 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-15  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/8385
+       * g++.dg/ext/typeof5.C: New test.
+
 2003-05-15  J"orn Rennecke <joern.rennecke@superh.com>
 
        * gcc.c-torture/execute/builtins/string-asm-1.c: Take
diff --git a/gcc/testsuite/g++.dg/ext/typeof5.C b/gcc/testsuite/g++.dg/ext/typeof5.C
new file mode 100644 (file)
index 0000000..d1ee4f7
--- /dev/null
@@ -0,0 +1,8 @@
+// { dg-options "" }
+
+int foo;
+
+template <class T> struct Base {};
+
+template <class T>
+struct Derived : public Base<typeof(foo)> {};