1 // RUN: %clang_cc1 %s -fsyntax-only -fms-extensions -std=c++11 -verify
4 using __super::foo
; // expected-error {{'__super' cannot be used with a using declaration}}
5 __super::XXX x
; // expected-error {{invalid use of '__super', Errors has no base classes}} expected-error {{expected}}
8 // expected-note@+4 {{replace parentheses with an initializer to declare a variable}}
9 // expected-warning@+3 {{empty parentheses interpreted as a function declaration}}
10 // expected-error@+2 {{C++ requires a type specifier for all declarations}}
11 // expected-error@+1 {{use of '__super' inside a lambda is unsupported}}
12 auto lambda
= []{ __super::foo(); };
19 static void static_foo() {}
24 struct Derived
: Base1
{
26 typedef __super::XXX Type
;
29 X
= sizeof(__super::XXX
)
39 return __super::foo(1);
43 __super::static_foo();
48 struct Inner
: Base1
{
49 static const int x
= sizeof(__super::XXX
);
57 struct MemberFunctionInMultipleBases
: Base1
, Base2
{
68 struct OverloadedMemberFunction
: Base3
{
74 struct PointerToMember
: Base1
{
75 template <void (Base1::*MP
)(int)>
83 void PointerToMember::baz() {
84 Wrapper
<&__super::foo
>::bar();
91 int foo() { return 0; }
94 struct DerivedFromKnownSpecialization
: BaseTemplate
<int> {
96 typedef __super::XXX b
;
100 typedef __super::XXX d
;
106 template <typename T
>
107 struct DerivedFromDependentBase
: BaseTemplate
<T
> {
108 typename
__super::XXX a
;
109 typedef typename
__super::XXX b
;
111 __super::XXX c
; // expected-error {{missing 'typename'}}
112 typedef __super::XXX d
; // expected-error {{missing 'typename'}}
115 typename
__super::XXX e
;
116 typedef typename
__super::XXX f
;
118 __super::XXX g
; // expected-error {{missing 'typename'}}
119 typedef __super::XXX h
; // expected-error {{missing 'typename'}}
121 int x
= __super::foo();
125 template <typename T
>
126 struct DerivedFromTemplateParameter
: T
{
127 typename
__super::XXX a
;
128 typedef typename
__super::XXX b
;
130 __super::XXX c
; // expected-error {{missing 'typename'}}
131 typedef __super::XXX d
; // expected-error {{missing 'typename'}}
134 typename
__super::XXX e
;
135 typedef typename
__super::XXX f
;
137 __super::XXX g
; // expected-error {{missing 'typename'}}
138 typedef __super::XXX h
; // expected-error {{missing 'typename'}}
145 DerivedFromDependentBase
<int> d
;
147 DerivedFromTemplateParameter
<Base1
> t
;
155 // Don't crash on dependent_type_var '->' '__super'
156 void f() { int a
= this->__super::a
; }