]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sun, 27 Feb 2005 18:10:41 +0000 (18:10 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sun, 27 Feb 2005 18:10:41 +0000 (18:10 +0000)
'gcc-3_4-branch'.

From-SVN: r95625

gcc/testsuite/g++.dg/parse/constant7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/error17.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wbraces2.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/parse/constant7.C b/gcc/testsuite/g++.dg/parse/constant7.C
new file mode 100644 (file)
index 0000000..c54ad55
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/19991
+enum { e = 1 };
+
+template<typename> struct A
+{
+  static const int i = e;
+  char a[i];
+};
diff --git a/gcc/testsuite/g++.dg/template/error17.C b/gcc/testsuite/g++.dg/template/error17.C
new file mode 100644 (file)
index 0000000..24b3644
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/20153
+
+template <typename T>
+void
+foo()
+{
+  union { struct { }; }; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wbraces2.C b/gcc/testsuite/g++.dg/warn/Wbraces2.C
new file mode 100644 (file)
index 0000000..b51d5ca
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/20175
+// { dg-options "-Wmissing-braces" }
+int a[2][2] = { 0, 1, 2, 3 };                   // { dg-warning "missing braces" }
+int b[2][2] = { { 0, 1 }, { 2, 3 } };
+int c[2][2] = { { { 0 }, 1 }, { 2, 3 } };       // { dg-error "brace-enclosed" }
+struct S { char s[6]; int i; };
+S d = { "hello", 1 };
+S e = { { "hello" }, 1 };
+S f = { { { "hello" } }, 1 };                   // { dg-error "brace-enclosed" }
+S g = { 'h', 'e', 'l', 'l', 'o', '\0', 1 };     // { dg-warning "missing braces" }
+struct T { wchar_t s[6]; int i; };
+T i = { L"hello", 1 };
+T j = { { L"hello" }, 1 };
+T k = { { { L"hello" } }, 1 };                  // { dg-error "brace-enclosed" }
+T l = { L'h', L'e', L'l', L'l', L'o', L'\0', 1 };// { dg-warning "missing braces" }