re PR c++/17413 (local classes as template argument)
authorMark Mitchell <mark@codesourcery.com>
Thu, 23 Dec 2004 19:54:09 +0000 (19:54 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 23 Dec 2004 19:54:09 +0000 (19:54 +0000)
PR c++/17413
* pt.c (check_instantiated_args): Remove bogus SFINAE code.

PR c++/17413
* g++.dg/template/local4.C: New test.
* g++.dg/template/crash19.C: Add dg-error marker.

From-SVN: r92562

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

index 4fe8bccf6cae4fc3e6452802d4e4241602343158..04ec9463dd95c2ff0f0474c59249b6946a542ffb 100644 (file)
@@ -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>
index 3c6f5bcbbdf291b5dd838c22f9aab4885ee2ba16..bbe892e416ee61299584d95d8641bb07093aa2bb 100644 (file)
@@ -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);
index 0cf0a4f047a0d3f40ae5adcdd5cfabc2ba504f2e..a7f4c7f4222e1eeb754b1a60cf5617b3375fc9e2 100644 (file)
@@ -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>
index a28827f31ac80ced0e4cffb3bdaef2c98719ee3f..59b4140c578b20b6031d5753b9dccdeae353e0d9 100644 (file)
@@ -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 (file)
index 0000000..53a5198
--- /dev/null
@@ -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" } 
+}