From a5a406af6492a832d56b9cb4e49c1b4d0461381d Mon Sep 17 00:00:00 2001 From: Brendan Kehoe Date: Tue, 18 Aug 1998 11:19:21 -0400 Subject: [PATCH] another expr/decl ambiguity test From-SVN: r21826 --- .../g++.old-deja/g++.brendan/parse4.C | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.brendan/parse4.C 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 - +} -- 2.30.2