// decl.C
// ----------------------------------------------------------------
// COMP 290-001: Algorithm Library Design, Lutz Kettner, 01/11/2000
// Ambiguous declarations in C++. Try to compile and see the error message.
// Adapted from the C++ Standard, clause 8.2, page 129.

struct S {
    S(int);
};

void foo( double d) {
    S v( int(d));   // function declaration
    S w(( int(d))); // object declaration
    S x( int());    // function declaration
    S y( int(d));   // object declaration
    S z = int(d);   // object declaration

    w = S(1); // o.k. since w is of type S
    w = v;    // fails because v is not of type S
    v = S(1); // fails because v is not of type S
}

// EOF //

