[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Lexer / cxx0x_keyword_as_cxx98.cpp
blob8f5fcf40b22ee68580061b383a020667436f64e6
1 // RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++11-compat -std=c++98
3 #define constexpr const
4 constexpr int x = 0;
5 #undef constexpr
7 namespace lib {
8 struct nullptr_t;
9 typedef nullptr_t nullptr; // expected-warning {{'nullptr' is a keyword in C++11}}
12 #define CONCAT(X,Y) CONCAT2(X,Y)
13 #define CONCAT2(X,Y) X ## Y
14 int CONCAT(constexpr,ession);
16 #define ID(X) X
17 extern int ID(decltype); // expected-warning {{'decltype' is a keyword in C++11}}
19 extern int CONCAT(align,of); // expected-warning {{'alignof' is a keyword in C++11}}
21 #define static_assert(b, s) int CONCAT(check, __LINE__)[(b) ? 1 : 0];
22 static_assert(1 > 0, "hello"); // ok
24 #define IF_CXX11(CXX11, CXX03) CXX03
25 typedef IF_CXX11(char16_t, wchar_t) my_wide_char_t; // ok
27 int alignas; // expected-warning {{'alignas' is a keyword in C++11}}
28 int alignof; // already diagnosed in this TU
29 int char16_t; // expected-warning {{'char16_t' is a keyword in C++11}}
30 int char32_t; // expected-warning {{'char32_t' is a keyword in C++11}}
31 int constexpr; // expected-warning {{'constexpr' is a keyword in C++11}}
32 int decltype; // already diagnosed in this TU
33 int noexcept; // expected-warning {{'noexcept' is a keyword in C++11}}
34 int nullptr; // already diagnosed in this TU
35 int static_assert; // expected-warning {{'static_assert' is a keyword in C++11}}
36 int thread_local; // expected-warning {{'thread_local' is a keyword in C++11}}