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 f375a4f..4c01679 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 ab6a75c..082bc78 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 2497dfd..be7261e 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)> {};