aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/crash19.C2
-rw-r--r--gcc/testsuite/g++.dg/template/local4.C11
5 files changed, 20 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4fe8bcc..04ec946 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2004-12-23 Mark Mitchell <mark@codesourcery.com>
+ PR c++/17413
+ * pt.c (check_instantiated_args): Remove bogus SFINAE code.
+
* cvt.c (convert_to_void): Fix typo in comment.
2004-12-23 Alexandre Oliva <aoliva@redhat.com>
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3c6f5bc..bbe892e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8926,9 +8926,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
if (nt)
{
- if (!(complain & tf_error))
- /*OK*/;
- else if (TYPE_ANONYMOUS_P (nt))
+ if (TYPE_ANONYMOUS_P (nt))
error ("%qT uses anonymous type", t);
else
error ("%qT uses local type %qT", t, nt);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0cf0a4f..a7f4c7f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2004-12-23 Mark Mitchell <mark@codesourcery.com>
+ PR c++/17413
+ * g++.dg/template/local4.C: New test.
+ * g++.dg/template/crash19.C: Add dg-error marker.
+
* g++.dg/template/crash31.C: Correct embedded PR number.
2004-12-23 Mark Mitchell <mark@codesourcery.com>
diff --git a/gcc/testsuite/g++.dg/template/crash19.C b/gcc/testsuite/g++.dg/template/crash19.C
index a28827f..59b4140 100644
--- a/gcc/testsuite/g++.dg/template/crash19.C
+++ b/gcc/testsuite/g++.dg/template/crash19.C
@@ -9,7 +9,7 @@ template <class T>
struct X {
enum { SIXTY_FOUR=64 };
struct node {
- unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
+ unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; // { dg-error "" }
void d() {}
};
node *head;
diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C
new file mode 100644
index 0000000..53a5198
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/local4.C
@@ -0,0 +1,11 @@
+// PR c++/17413
+
+template <typename T> void foo() {}
+
+int main () {
+ struct S {};
+ // We do not simply use "local|match" on line 10 because we want to
+ // make sure that "local" appears.
+ // { dg-error "local" "" { target *-*-* } 10 }
+ foo<S> (); // { dg-error "match" }
+}