From: Brendan Kehoe Date: Tue, 18 Aug 1998 15:19:21 +0000 (-0400) Subject: another expr/decl ambiguity test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5a406af6492a832d56b9cb4e49c1b4d0461381d;p=gcc.git another expr/decl ambiguity test From-SVN: r21826 --- diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/parse4.C b/gcc/testsuite/g++.old-deja/g++.brendan/parse4.C new file mode 100644 index 00000000000..95995ffd1a0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.brendan/parse4.C @@ -0,0 +1,24 @@ +// Build don't link: + +// this is marked as an expected error because it evidences an +// ambiguity in the grammar between expressions and declarations. +// when the parser's been cleaned up or rewritten, the error +// marker can go away, since it'll no longer occur. + +class B +{ +public: + B( int t ) {} + void f() {} +}; + +int g() { return 0; } + +main() +{ + int try1; + B( try1 ).f(); // no syntax error + B b( g() ); // no syntax error + B( ::g() ).f(); // no syntax error + B( g() ).f(); // syntax error before `.' // ERROR - +}