[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Lexer / bitint-constants-compat.c
blobd8bff94ef88caa39ca4edec28bbc0bc5b71ca11f
1 // RUN: %clang_cc1 -std=c17 -fsyntax-only -verify=ext -Wno-unused %s
2 // RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=compat -Wpre-c2x-compat -Wno-unused %s
3 // RUN: %clang_cc1 -fsyntax-only -verify=cpp -Wbit-int-extension -Wno-unused -x c++ %s
5 #if 18446744073709551615uwb // ext-warning {{'_BitInt' suffix for literals is a C23 extension}} \
6 compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C23}} \
7 cpp-error {{invalid suffix 'uwb' on integer constant}}
8 #endif
10 #if 18446744073709551615__uwb // ext-error {{invalid suffix '__uwb' on integer constant}} \
11 compat-error {{invalid suffix '__uwb' on integer constant}} \
12 cpp-warning {{'_BitInt' suffix for literals is a Clang extension}}
13 #endif
15 void func(void) {
16 18446744073709551615wb; // ext-warning {{'_BitInt' suffix for literals is a C23 extension}} \
17 compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C23}} \
18 cpp-error {{invalid suffix 'wb' on integer constant}}
20 18446744073709551615__wb; // ext-error {{invalid suffix '__wb' on integer constant}} \
21 compat-error {{invalid suffix '__wb' on integer constant}} \
22 cpp-warning {{'_BitInt' suffix for literals is a Clang extension}}