1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
4 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
11 x
.int; // expected-error{{expected unqualified-id}}
12 x
.~int(); // expected-error{{expected a class name}}
13 x
.operator; // expected-error{{expected a type}}
14 x
.operator typedef; // expected-error{{expected a type}} expected-error{{type name does not allow storage class}}
20 x
->int; // expected-error{{expected unqualified-id}}
21 x
->~int(); // expected-error{{expected a class name}}
22 x
->operator; // expected-error{{expected a type}}
23 x
->operator typedef; // expected-error{{expected a type}} expected-error{{type name does not allow storage class}}
28 template <class A
, class B
> struct pair
{};
29 template <class _E
> class initializer_list
{};
30 template <typename _Tp
> pair
<_Tp
, _Tp
> minmax(initializer_list
<_Tp
> __l
) {};
33 pair
<int, int> z
= minmax({});
34 #if __cplusplus <= 199711L // C++03 or earlier modes
35 // expected-error@-2 {{expected expression}}
37 // expected-error@-4 {{no matching function for call to 'minmax'}}
38 // expected-note@-8 {{candidate template ignored: couldn't infer template argument '_Tp'}}
48 string::iterator i
= s
.foo(); // expected-error {{no member named 'foo'}}
53 // Make sure we don't crash.
54 namespace rdar11293995
{
57 explicit Length(PassRefPtr
<CalculationValue
>); // expected-error {{undeclared identifier 'CalculationValue'}}
65 enum EFillSizeType
{ Contain
, Cover
, SizeLength
, SizeNone
};
74 void setSize(FillSize f
) { m_sizeType
= f
.type
;}
76 unsigned m_sizeType
: 2;