[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CXX / stmt.stmt / stmt.ambig / p1-0x.cpp
blob81e8e25b4c4fa77a807b36efa3167a7461d42505
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 struct T {
4 struct x {
5 int m;
6 };
7 x* operator->();
8 void operator++(int);
9 void operator<<(int);
10 T();
11 T(int);
12 T(int, int);
15 template<typename A, typename B, typename C, typename D, typename E>
16 void func(A, B, C, D, E);
18 void func(int a, int c) {
19 T(a)->m = 7;
20 T(a)++;
21 T(a,5)<<c;
23 T(*d)(int);
24 T(e)[5];
25 T(f) = {1, 2};
26 T(*g)(double(3)); // expected-error{{cannot initialize a variable of type 'T (*)' with an rvalue of type 'double'}}
27 func(a, d, e, f, g);
30 void func2(int a, int c) {
31 decltype(T())(a)->m = 7;
32 decltype(T())(a)++;
33 decltype(T())(a,5)<<c;
35 decltype(T())(*d)(int);
36 decltype(T())(e)[5];
37 decltype(T())(f) = {1, 2};
38 decltype(T())(*g)(double(3)); // expected-error{{cannot initialize a variable of type 'decltype(T()) (*)' (aka 'T *') with an rvalue of type 'double'}}
39 func(a, d, e, f, g);