1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
23 operator decltype(outer::middle::inner()) ();
24 operator decltype(outer::middle())::inner2 ();
25 operator decltype(outer())::middle::inner3 ();
26 str(int (decltype(outer::middle::inner())::*n
)(),
27 int (decltype(outer::middle())::inner::*o
)(),
28 int (decltype(outer())::middle::inner::*p
)());
31 decltype(outer::middle::inner()) a
;
33 a
.decltype(outer::middle())::mfunc(); // expected-error{{'PR10127::outer::middle::mfunc' is not a member of class 'decltype(outer::middle::inner())'}}
34 a
.decltype(outer::middle::inner())::func();
35 a
.decltype(outer::middle())::inner::func();
36 a
.decltype(outer())::middle::inner::func();
38 a
.decltype(outer())::middle::inner::~inner();
40 decltype(outer())::middle::inner().func();
42 decltype(outer::middle())::inner b
;
43 decltype(outer())::middle::inner c
;
44 decltype(outer())::fail d
; // expected-error{{no type named 'fail' in 'PR10127::outer'}}
45 decltype(outer())::fail::inner e
; // expected-error{{no member named 'fail' in 'PR10127::outer'}}
46 decltype()::fail f
; // expected-error{{expected expression}}
47 decltype()::middle::fail g
; // expected-error{{expected expression}}
50 decltype(int())::PR10127::outer i
; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or enumeration}}
51 decltype(int())::global j
; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or enumeration}}
53 outer::middle k
= decltype(outer())::middle();
54 outer::middle::inner l
= decltype(outer())::middle::inner();
58 typename
decltype(T())::middle::inner x
; // expected-error{{type 'decltype(int())' (aka 'int') cannot be used prior to '::' because it has no members}}
61 template class templ
<int>; // expected-note{{in instantiation of template class 'PR10127::templ<int>' requested here}}
62 template class templ
<outer
>;
69 foo m
= decltype(foo::bar
)::baz
;
74 enum E
: decltype(outer())::td_int(4); // expected-error{{anonymous bit-field}}
75 enum F
: decltype(outer())::td_int
;
76 enum G
: decltype; // expected-error{{expected '(' after 'decltype'}}
77 enum H
: 4; // expected-error {{anonymous bit-field}}