]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Fri, 10 Dec 2004 16:13:47 +0000 (16:13 +0000)
committerNo Author <no-author@gcc.gnu.org>
Fri, 10 Dec 2004 16:13:47 +0000 (16:13 +0000)
'gcc-3_4-branch'.

From-SVN: r91994

gcc/testsuite/g++.dg/parse/struct-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/struct-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/struct-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/typename7.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/attr-mode-2.c [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/parse/struct-1.C b/gcc/testsuite/g++.dg/parse/struct-1.C
new file mode 100644 (file)
index 0000000..6e0d93a
--- /dev/null
@@ -0,0 +1,4 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct T::A {}; // { dg-error "invalid class name" }
diff --git a/gcc/testsuite/g++.dg/parse/struct-2.C b/gcc/testsuite/g++.dg/parse/struct-2.C
new file mode 100644 (file)
index 0000000..b63045b
--- /dev/null
@@ -0,0 +1,7 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct A
+{
+    struct T::B {}; // { dg-error "invalid class name" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/struct-3.C b/gcc/testsuite/g++.dg/parse/struct-3.C
new file mode 100644 (file)
index 0000000..8e73ce4
--- /dev/null
@@ -0,0 +1,10 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+struct A
+{
+    struct B;
+    typedef B C;
+};
+
+struct A::C {}; // { dg-error "invalid class name" }
diff --git a/gcc/testsuite/g++.dg/parse/typename7.C b/gcc/testsuite/g++.dg/parse/typename7.C
new file mode 100644 (file)
index 0000000..2119317
--- /dev/null
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de> and
+// Alexandre Oliva <aoliva@redhat.com>
+
+// PR c++/18757: ICE in get_innermost_template_args
+
+struct A
+{
+  template<typename>   void foo(int);
+  template<typename T> void bar(T t) {
+    this->foo<typename T>(t); } // { dg-error "expected" }
+  template<typename T> void bad(T t) {
+    foo<typename T>(t); } // { dg-error "expected" }
+};
+
+template <typename T>
+struct B
+{
+  void bar(T t) {
+    A().bar<typename T>(t); } // { dg-error "expected" }
+  void bad(T t) {
+    B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
+};
+
+void baz()
+{
+    A().bar(0);
+    A().bad(0);
+    B<int>().bar(0);
+}
diff --git a/gcc/testsuite/gcc.dg/attr-mode-2.c b/gcc/testsuite/gcc.dg/attr-mode-2.c
new file mode 100644 (file)
index 0000000..1a02521
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR c/18282 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int tword __attribute__((mode(word)));
+
+typedef enum { B1 = 1 } B;
+typedef enum { C1 = 1 } C __attribute__ ((mode(QI)));
+typedef enum { D1 = 1 } __attribute__ ((mode(word))) D;
+
+B __attribute__ ((mode (QI))) bqi;
+B __attribute__ ((mode (word))) bword;
+
+int sqi[sizeof (bqi) == 1 ? 1 : -1];
+int sword[sizeof (bword) == sizeof(tword) ? 1 : -1];
+int sc[sizeof (C) == 1 ? 1 : -1];
+int sd[sizeof (D) == sizeof(tword) ? 1 : -1];
+
+int aqi[__alignof (bqi) == 1 ? 1 : -1];
+int aword[__alignof (bword) == __alignof(tword) ? 1 : -1];
+int ac[__alignof (C) == 1 ? 1 : -1];
+int ad[__alignof (D) == __alignof(tword) ? 1 : -1];