cxx-ambig-paren-expr.cpp [plain text]
void f() {
typedef int T;
int x, *px;
(T())x; (T())+x; (T())*px;
x = (T());
x = (T())/x;
typedef int *PT;
x = (PT()[(int){1}]);
struct S{int operator()();};
(S())();
}
typedef int type;
struct rec { rec(int); };
namespace ns {
typedef int type;
struct rec { rec(int); };
}
struct cls {
typedef int type;
struct rec { rec(int); };
};
struct result {
template <class T> result(T);
bool check();
};
void test(int i) {
if (result((cls::type) i).check())
return;
if (result((ns::type) i).check())
return;
if (result((::type) i).check())
return;
if (result((cls::rec) i).check())
return;
if (result((ns::rec) i).check())
return;
if (result((::rec) i).check())
return;
}