//===----------------------------------------------------------------------===//
#include "clang/Lex/TokenConcatenation.h"
+#include "clang/Basic/CharInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/Support/ErrorHandling.h"
-#include <cctype>
using namespace clang;
return IsIdentifierStringPrefix(PrevTok);
case tok::numeric_constant:
- return isalnum(FirstChar) || Tok.is(tok::numeric_constant) ||
- FirstChar == '+' || FirstChar == '-' || FirstChar == '.' ||
- (PP.getLangOpts().CPlusPlus11 && FirstChar == '_');
+ return isPreprocessingNumberBody(FirstChar) ||
+ FirstChar == '+' || FirstChar == '-';
case tok::period: // ..., .*, .1234
return (FirstChar == '.' && PrevPrevTok.is(tok::period)) ||
- isdigit(FirstChar) ||
- (PP.getLangOpts().CPlusPlus && FirstChar == '*');
+ isDigit(FirstChar) ||
+ (PP.getLangOpts().CPlusPlus && FirstChar == '*');
case tok::amp: // &&
return FirstChar == '&';
case tok::plus: // ++
-// RUN: %clang_cc1 -E %s -o - | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck -strict-whitespace %s
#define y(a) ..a
#define TYPEDEF(guid) typedef [uuid(guid)]
TYPEDEF(66504301-BE0F-101A-8BBB-00AA00300CAB) long OLE_COLOR;
// CHECK: typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB)] long OLE_COLOR;
+
+// Be careful with UD-suffixes.
+#define StrSuffix() "abc"_suffix
+#define IntSuffix() 123_suffix
+UD: StrSuffix()ident
+UD: IntSuffix()ident
+// CHECK: UD: "abc"_suffix ident
+// CHECK: UD: 123_suffix ident