summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx98-compat-pedantic.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-15 01:18:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-15 01:18:56 +0000
commitacd4d3d52abb9d35154c98911d60124ceeb765a9 (patch)
treedadd819030712fc9caabe30734c0fb57584d0068 /clang/test/SemaCXX/cxx98-compat-pedantic.cpp
parent6d9f5db46801a5fb8d17388216820ed7cee5accb (diff)
downloadbcm5719-llvm-acd4d3d52abb9d35154c98911d60124ceeb765a9.tar.gz
bcm5719-llvm-acd4d3d52abb9d35154c98911d60124ceeb765a9.zip
-Wc++98-compat warnings for the lexer.
This also adds a -Wc++98-compat-pedantic for warning on constructs which would be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features which we enable by default, with no warning, in C++98 mode). llvm-svn: 142034
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat-pedantic.cpp')
-rw-r--r--clang/test/SemaCXX/cxx98-compat-pedantic.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat-pedantic.cpp b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp
new file mode 100644
index 00000000000..2ca0ae4d1ec
--- /dev/null
+++ b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat-pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Werror %s
+
+// -Wc++98-compat-pedantic warns on C++11 features which we accept without a
+// warning in C++98 mode.
+
+#line 32767 // ok
+#line 32768 // expected-warning {{#line number greater than 32767 is incompatible with C++98}}
+
+#define VA_MACRO(x, ...) x // expected-warning {{variadic macros are incompatible with C++98}}
+VA_MACRO(,x) // expected-warning {{empty macro argument list is incompatible with C++98}}
OpenPOWER on IntegriCloud