-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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142034 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp
index f3f323f..6a3881c 100644
--- a/test/SemaCXX/cxx98-compat.cpp
+++ b/test/SemaCXX/cxx98-compat.cpp
@@ -11,3 +11,20 @@
int alignas(8) with_alignas; // expected-warning {{'alignas' is incompatible with C++98}}
int with_attribute [[ ]]; // expected-warning {{attributes are incompatible with C++98}}
+
+void Literals() {
+ (void)u8"str"; // expected-warning {{unicode literals are incompatible with C++98}}
+ (void)u"str"; // expected-warning {{unicode literals are incompatible with C++98}}
+ (void)U"str"; // expected-warning {{unicode literals are incompatible with C++98}}
+ (void)u'x'; // expected-warning {{unicode literals are incompatible with C++98}}
+ (void)U'x'; // expected-warning {{unicode literals are incompatible with C++98}}
+
+ (void)u8R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
+ (void)uR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
+ (void)UR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
+ (void)R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
+ (void)LR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
+}
+
+template<typename T> struct S {};
+S<::S<void> > s; // expected-warning {{'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98}}