summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/fixit.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2016-12-21 18:33:17 +0000
committerPaul Robinson <paul.robinson@sony.com>2016-12-21 18:33:17 +0000
commit80ba2929e6e757d831ede45cb56186cb66e7ca23 (patch)
treed203befb9edf7f6592142240dd94224c69acacd4 /clang/test/FixIt/fixit.cpp
parent88f15eedbbf49c88f4386e0400936b8874fd5717 (diff)
downloadbcm5719-llvm-80ba2929e6e757d831ede45cb56186cb66e7ca23.tar.gz
bcm5719-llvm-80ba2929e6e757d831ede45cb56186cb66e7ca23.zip
Make some diagnostic tests C++11 clean.
Differential Revision: http://reviews.llvm.org/D27794 llvm-svn: 290262
Diffstat (limited to 'clang/test/FixIt/fixit.cpp')
-rw-r--r--clang/test/FixIt/fixit.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/clang/test/FixIt/fixit.cpp b/clang/test/FixIt/fixit.cpp
index 686cc23d635..c43aac98623 100644
--- a/clang/test/FixIt/fixit.cpp
+++ b/clang/test/FixIt/fixit.cpp
@@ -1,8 +1,12 @@
-// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s
+// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++98 %s
+// RUN: cp %s %t-98
+// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++98 %t-98
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++98 %t-98
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s
-// RUN: cp %s %t
-// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t
+// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ -std=c++11 %s
+// RUN: cp %s %t-11
+// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ -std=c++11 %t-11
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ -std=c++11 %t-11
/* This is a test of the various code modification hints that are
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
template<int Value> struct CT { template<typename> struct Inner; }; // expected-note{{previous use is here}}
+// FIXME: In C++11 this gets 'expected unqualified-id' which fixit can't fix.
+// Probably parses as `CT<10> > 2 > ct;` rather than `CT<(10 >> 2)> ct;`.
+#if __cplusplus < 201103L
CT<10 >> 2> ct; // expected-warning{{require parentheses}}
+#endif
class C3 {
public:
@@ -41,7 +49,11 @@ protected:
};
class B : public A {
+#if __cplusplus >= 201103L
+ A::foo; // expected-error{{ISO C++11 does not allow access declarations}}
+#else
A::foo; // expected-warning{{access declarations are deprecated}}
+#endif
};
void f() throw(); // expected-note{{previous}}
@@ -285,8 +297,10 @@ namespace greatergreater {
void (*p)() = &t<int>;
(void)(&t<int>==p); // expected-error {{use '> ='}}
(void)(&t<int>>=p); // expected-error {{use '> >'}}
+#if __cplusplus < 201103L
(void)(&t<S<int>>>=p); // expected-error {{use '> >'}}
(Shr)&t<S<int>>>>=p; // expected-error {{use '> >'}}
+#endif
// FIXME: We correct this to '&t<int> > >= p;' not '&t<int> >>= p;'
//(Shr)&t<int>>>=p;
OpenPOWER on IntegriCloud