llvm-project/clang/test/CXX
Jordan Rose 7f43dddae0 Handle universal character names and Unicode characters outside of literals.
This is a missing piece for C99 conformance.

This patch handles UCNs by adding a '\\' case to LexTokenInternal and
LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN.
If the UCN is not syntactically well-formed, we fall back to the old
treatment: a backslash followed by an identifier beginning with 'u' (or 'U').

Because the spelling of an identifier with UCNs still has the UCN in it, we
need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo.

Of course, valid code that does *not* use UCNs will see only a very minimal
performance hit (checks after each identifier for non-ASCII characters,
checks when converting raw_identifiers to identifiers that they do not
contain UCNs, and checks when getting the spelling of an identifier that it
does not contain a UCN).

This patch also adds basic support for actual UTF-8 in the source. This is
treated almost exactly the same as UCNs except that we consider stray
Unicode characters to be mistakes and offer a fixit to remove them.

llvm-svn: 173369
2013-01-24 20:50:46 +00:00
..
basic Properly compute triviality for explicitly-defaulted or deleted special members. 2012-12-08 02:53:02 +00:00
class Properly compute triviality for explicitly-defaulted or deleted special members. 2012-12-08 02:53:02 +00:00
class.access Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
class.derived Fix CXXRecordDecl::forallBases to not look through bases which are dependent 2012-11-22 00:24:47 +00:00
conv Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
dcl.dcl Implement C++11 semantics for [[noreturn]] attribute. This required splitting 2013-01-17 01:30:42 +00:00
dcl.decl Fixed an assertion failure triggered by invalid code. 2013-01-11 14:34:39 +00:00
except PR14141 (part of DR1351): An implicitly-deduced "any" exception specification 2012-10-21 23:00:34 +00:00
expr Implement C++11 semantics for [[noreturn]] attribute. This required splitting 2013-01-17 01:30:42 +00:00
lex Test that we correctly handle reversion of line splicing etc in raw string 2013-01-17 01:46:13 +00:00
over Handle universal character names and Unicode characters outside of literals. 2013-01-24 20:50:46 +00:00
special Improve diagnostic wording for when an implicitly-deleted special member 2012-12-28 12:23:24 +00:00
stmt.stmt Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
temp Once we've collected the template arguments for a 2013-01-18 22:27:09 +00:00