]> granicus.if.org Git - clang/commitdiff
Add __char16_t and __char32_t as aliases for the C++0x char16_t and
authorDouglas Gregor <dgregor@apple.com>
Mon, 13 Sep 2010 23:21:44 +0000 (23:21 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 13 Sep 2010 23:21:44 +0000 (23:21 +0000)
char32_t, respectively, but which can also be used in C++98/03
mode. Fixes <rdar://problem/8418510>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113813 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TokenKinds.def
test/Lexer/clang-keywords.cpp [new file with mode: 0644]
test/Lexer/cxx0x_keyword_as_cxx98.cpp

index 9fd3c753fb12419925ef90feeb4930438c253c7b..8e0653464167747ee3a9edd91d6f5f3a7ee77a55 100644 (file)
@@ -381,6 +381,11 @@ ALIAS("_uuidof"      , __uuidof   , KEYMS | KEYBORLAND)
 // Borland Extensions which should be disabled in strict conformance mode.
 ALIAS("_pascal"      , __pascal   , KEYBORLAND)
 
+// Clang Extensions.
+ALIAS("__char16_t"   , char16_t   , KEYCXX)
+ALIAS("__char32_t"   , char32_t   , KEYCXX)
+
+
 //===----------------------------------------------------------------------===//
 // Objective-C @-preceeded keywords.
 //===----------------------------------------------------------------------===//
diff --git a/test/Lexer/clang-keywords.cpp b/test/Lexer/clang-keywords.cpp
new file mode 100644 (file)
index 0000000..a349b44
--- /dev/null
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+__char16_t c16;
+void f(__char32_t) { }
index 2bfb8b0b931befd713214c1b42a985dba9cb3ded..0223b039be9295d0b96424a0e6f186284853f8bf 100644 (file)
@@ -1,2 +1,3 @@
-// RUN: %clang_cc1 %s -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only
 int static_assert;
+int char16_t;