1
- // RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s
1
+ // RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++98 %s
2
+ // RUN: cp %s %t-98
3
+ // RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++98 %t-98
4
+ // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++98 %t-98
2
5
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
3
- // RUN: cp %s %t
4
- // RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
5
- // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t
6
+ // RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++11 %s
7
+ // RUN: cp %s %t-11
8
+ // RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++11 %t-11
9
+ // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++11 %t-11
6
10
7
11
/* This is a test of the various code modification hints that are
8
12
provided as part of warning or extension diagnostics. All of the
@@ -21,7 +25,11 @@ static void C1::g() { } // expected-error{{'static' can only be specified inside
21
25
22
26
template <int Value> struct CT { template <typename > struct Inner ; }; // expected-note{{previous use is here}}
23
27
28
+ // FIXME: In C++11 this gets 'expected unqualified-id' which fixit can't fix.
29
+ // Probably parses as `CT<10> > 2 > ct;` rather than `CT<(10 >> 2)> ct;`.
30
+ #if __cplusplus < 201103L
24
31
CT<10 >> 2 > ct; // expected-warning{{require parentheses}}
32
+ #endif
25
33
26
34
class C3 {
27
35
public:
@@ -41,7 +49,11 @@ class A {
41
49
};
42
50
43
51
class B : public A {
52
+ #if __cplusplus >= 201103L
53
+ A::foo; // expected-error{{ISO C++11 does not allow access declarations}}
54
+ #else
44
55
A::foo; // expected-warning{{access declarations are deprecated}}
56
+ #endif
45
57
};
46
58
47
59
void f () throw(); // expected-note{{previous}}
@@ -285,8 +297,10 @@ namespace greatergreater {
285
297
void (*p)() = &t<int >;
286
298
(void )(&t<int >==p); // expected-error {{use '> ='}}
287
299
(void )(&t<int >>=p); // expected-error {{use '> >'}}
300
+ #if __cplusplus < 201103L
288
301
(void )(&t<S<int >>>=p); // expected-error {{use '> >'}}
289
302
(Shr)&t<S<int >>>>=p; // expected-error {{use '> >'}}
303
+ #endif
290
304
291
305
// FIXME: We correct this to '&t<int> > >= p;' not '&t<int> >>= p;'
292
306
// (Shr)&t<int>>>=p;
0 commit comments