]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/decltype-call1.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype-call1.C
1 // PR c++/52748
2 // N3276
3 // { dg-do compile { target c++11 } }
4
5 struct A; // { dg-message "forward declaration" }
6 A f();
7
8 decltype(f()) g1(); // OK
9 decltype(((f()))) g2b(); // OK
10 decltype(42,f()) g3(); // OK
11 decltype(42,45,f()) g3b(); // OK
12 decltype(42,45,(f())) g3c(); // OK
13 decltype(42,((45,(f())))) g3c(); // OK
14
15 decltype(f(),42) g4(); // { dg-error "" }
16 decltype(45,f(),42) g4b(); // { dg-error "" }
17
18 class B
19 {
20 ~B(); // { dg-message "private" }
21 public:
22 int i;
23 void operator[](int);
24 };
25 B h();
26
27 void i(const B&);
28
29 decltype(h()) g5a(); // OK
30 decltype(h().i) g5(); // { dg-error "" }
31 decltype(h()[0]) g6(); // { dg-error "" }
32 decltype(i(h())) g7(); // { dg-error "" }
This page took 0.043265 seconds and 5 git commands to generate.