From: Marek Polacek Date: Mon, 13 Jul 2020 17:05:06 +0000 (-0400) Subject: c++: Add test [PR95288] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a9a3434c7396ea14c8f9c291694faea382c36dc;p=gcc.git c++: Add test [PR95288] Somewhat improved by r11-2064, though we still generate junk that seems redundant. But at least it says error: expected ‘}’ before ‘.’ token PR c++/95288 * g++.dg/diagnostic/enum2.C: New test. --- diff --git a/gcc/testsuite/g++.dg/diagnostic/enum2.C b/gcc/testsuite/g++.dg/diagnostic/enum2.C new file mode 100644 index 00000000000..e6e8320e3b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/enum2.C @@ -0,0 +1,10 @@ +// PR c++/95288 + +void f() +{ + enum X + { // { dg-message "to match this" } + a. // { dg-error "expected" } + b + }; // { dg-error "extra" "" { target c++98_only } } +} // { dg-error "expected" }