c7629d941557f7179eb8fa8a2e2a74d749cbaf7c |
|
24-Jan-2013 |
Jordan Rose <jordan_rose@apple.com> |
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|
aa9a8ce5d31975900c7243b1508f5111baddacbe |
|
20-Oct-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
DR1473: Do not require a space between operator"" and the ud-suffix in a literal-operator-id. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|
2fb4ae36825ca3a0cbe7e845c5747062870066be |
|
08-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not starting with an underscore is ill-formed. Since this rule rejects programs that were using <inttypes.h>'s macros, recover from this error by treating the ud-suffix as a separate preprocessing-token, with a DefaultError ExtWarn. The approach of treating such cases as two tokens is under discussion for standardization, but is in any case a conforming extension and allows existing codebases to keep building while the committee makes up its mind. Reword the warning on the definition of literal operators not starting with underscores (which are, strangely, legal) to more explicitly state that such operators can't be called by literals. Remove the special-case diagnostic for hexfloats, since it was both triggering in the wrong cases and incorrect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|
99831e4677a7e2e051af636221694d60ba31fcdb |
|
06-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
User-defined literals: reject string and character UDLs in all places where the grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|
5cc2c6eb67b6e5361bbe96f79b519fd62ec666d6 |
|
05-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Lexing support for user-defined literals. Currently these lex as the same token kinds as the underlying string literals, and we silently drop the ud-suffix; those issues will be fixed by subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|
b4a7b1e587a232c95d02a8ca10eeba60164fbba1 |
|
04-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Add tests for [over.literal]. Fix a few bugs which were exposed by the tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/over/over.oper/over.literal/p8.cpp
|