[committed] c++: Add test for DR 188.

Message ID 20200716161323.768809-1-polacek@redhat.com
State New
Headers show
Series
  • [committed] c++: Add test for DR 188.
Related show

Commit Message

Ian Lance Taylor via Gcc-patches July 16, 2020, 4:13 p.m.
Tested x86_64-pc-linux-gnu, applying to trunk.

gcc/testsuite/ChangeLog:

	DR 188
	* g++.dg/DRs/dr188.C: New test.
---
 gcc/testsuite/g++.dg/DRs/dr188.C | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/DRs/dr188.C


base-commit: a4f49061b6d921f72b2faf4843144f3c75f828f7
-- 
2.26.2

Patch

diff --git a/gcc/testsuite/g++.dg/DRs/dr188.C b/gcc/testsuite/g++.dg/DRs/dr188.C
new file mode 100644
index 00000000000..f29a9eba1c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr188.C
@@ -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, "");