summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx98-compat.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 22:27:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 22:27:51 +0000
commit26b75c07317a3b50a8a00a1623e3ef38af1d8349 (patch)
tree7a996e959bd9bb606c4374000762a9118a92168c /test/SemaCXX/cxx98-compat.cpp
parente7d6ca079a68ed9ea7fa6e5d6bfc9f625a37df76 (diff)
Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in literals in C++11. Extend such support to cover string literals as well as character literals, and mark N2170 as done. This seems too minor to warrant a release note to me. Let me know if you disagree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx98-compat.cpp')
-rw-r--r--test/SemaCXX/cxx98-compat.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp
index e9ba0dffc3..903932c189 100644
--- a/test/SemaCXX/cxx98-compat.cpp
+++ b/test/SemaCXX/cxx98-compat.cpp
@@ -281,3 +281,10 @@ namespace UnevaluatedMemberAccess {
int k = sizeof(S::n); // expected-warning {{use of non-static data member 'n' in an unevaluated context is incompatible with C++98}}
const std::type_info &ti = typeid(S::n); // expected-warning {{use of non-static data member 'n' in an unevaluated context is incompatible with C++98}}
}
+
+namespace LiteralUCNs {
+ char c1 = '\u001e'; // expected-warning {{universal character name referring to a control character is incompatible with C++98}}
+ wchar_t c2 = L'\u0041'; // expected-warning {{specifying character 'A' with a universal character name is incompatible with C++98}}
+ const char *s1 = "foo\u0031"; // expected-warning {{specifying character '1' with a universal character name is incompatible with C++98}}
+ const wchar_t *s2 = L"bar\u0085"; // expected-warning {{universal character name referring to a control character is incompatible with C++98}}
+}