aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-05-15 17:00:06 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-05-15 17:00:06 +0000
commitdffbbe8019dd880e4dcc4a66670acd7449cede92 (patch)
tree2c9881d9772b638bfcd2d1bdac48cadb15da8c1c
parent411f7850d7f7c165a303de713d0307b221420bce (diff)
downloadgcc-dffbbe8019dd880e4dcc4a66670acd7449cede92.zip
gcc-dffbbe8019dd880e4dcc4a66670acd7449cede92.tar.gz
gcc-dffbbe8019dd880e4dcc4a66670acd7449cede92.tar.bz2
re PR c++/8385 (typeof(...) as template arg)
PR c++/8385 * g++.dg/ext/typeof5.C: New test. PR c++/8385 * semantics.c (finish_typeof): Refine type-dependency check. From-SVN: r66835
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/typeof5.C8
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f375a4f..4c01679 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ab6a75c..082bc78 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2497dfd..be7261e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..d1ee4f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/typeof5.C
@@ -0,0 +1,8 @@
+// { dg-options "" }
+
+int foo;
+
+template <class T> struct Base {};
+
+template <class T>
+struct Derived : public Base<typeof(foo)> {};