• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -fsyntax-only %s -verify
2// RUN: %clang_cc1 -fsyntax-only -std=c++98 %s -verify
3// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
4
5// <rdar://problem/11286701>
6namespace std {
7  template<typename T, typename U> class pair;
8}
9
10@interface NSObject
11@end
12
13@interface Test : NSObject
14@end
15
16@implementation Test
17
18struct EvilStruct {
19} // expected-error {{expected ';' after struct}}
20
21  typedef std::pair<int, int> IntegerPair;
22
23template<typename...Ts> void f(Ts); // expected-error {{unexpanded}}
24#if __cplusplus <= 199711L // C++03 or earlier modes
25// expected-warning@-2 {{variadic templates are a C++11 extension}}
26#endif
27@end
28
29// rdar://20560175
30
31struct OuterType {
32  typedef int InnerType;
33};
34
35namespace ns {
36  typedef int InnerType;
37};
38
39@protocol InvalidProperties
40
41@property (nonatomic) (OuterType::InnerType) invalidTypeParens;
42// expected-error@-1 {{type name requires a specifier or qualifier}}
43// expected-error@-2 {{property requires fields to be named}}
44// expected-error@-3 {{expected ';' at end of declaration list}}
45// expected-error@-4 {{C++ requires a type specifier for all declarations}}
46// expected-error@-5 {{cannot declare variable inside @interface or @protocol}}
47
48@property (nonatomic) (ns::InnerType) invalidTypeParens2;
49// expected-error@-1 {{type name requires a specifier or qualifier}}
50// expected-error@-2 {{property requires fields to be named}}
51// expected-error@-3 {{expected ';' at end of declaration list}}
52// expected-error@-4 {{C++ requires a type specifier for all declarations}}
53// expected-error@-5 {{cannot declare variable inside @interface or @protocol}}
54
55@property (nonatomic) int OuterType::InnerType; // expected-error {{property requires fields to be named}}
56
57@property (nonatomic) int OuterType::InnerType foo; // expected-error {{property requires fields to be named}}
58// expected-error@-1 {{expected ';' at end of declaration list}}
59// expected-error@-2 {{C++ requires a type specifier for all declarations}}
60// expected-error@-3 {{cannot declare variable inside @interface or @protocol}}
61
62@end
63