aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/parse4.C
blob: 6526c6059519eb0e021c2981d3a5ac9c74f047f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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; } // gets bogus error - referenced below XFAIL *-*-*

int main()
{
    int try1;
    B( try1 ).f();   // no syntax error
    B b( g() );      // no syntax error
    B( ::g() ).f();  // no syntax error 
    B( g() ).f();    // gets bogus error - treated as decl XFAIL *-*-*
}