c++: Add test for DR 188.
authorMarek Polacek <polacek@redhat.com>
Thu, 16 Jul 2020 16:11:25 +0000 (12:11 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 16 Jul 2020 16:11:42 +0000 (12:11 -0400)
gcc/testsuite/ChangeLog:

DR 188
* g++.dg/DRs/dr188.C: New test.

gcc/testsuite/g++.dg/DRs/dr188.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/DRs/dr188.C b/gcc/testsuite/g++.dg/DRs/dr188.C
new file mode 100644 (file)
index 0000000..f29a9eb
--- /dev/null
@@ -0,0 +1,7 @@
+// DR 188
+// { dg-do compile { target c++11 } }
+// From [diff.expr]p5.
+
+char arr[100];
+// Yields 100 in C++ and sizeof(char*) in C.
+static_assert (sizeof (0, arr) == 100, "");