[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / builtin-redecl.cpp
blob323c63e20288339ca85479ee16fd9da782fbb9a4
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 // RUN: %clang_cc1 %s -fsyntax-only -verify -x c
3 // RUN: %clang_cc1 %s -fsyntax-only -verify -fms-compatibility
5 typedef __typeof__(sizeof(0)) size_t;
7 // Redeclaring library builtins is OK.
8 void exit(int);
10 // expected-error@+2 {{cannot redeclare builtin function '__builtin_va_copy'}}
11 // expected-note@+1 {{'__builtin_va_copy' is a builtin with type}}
12 void __builtin_va_copy(double d);
14 // expected-error@+2 {{cannot redeclare builtin function '__builtin_va_end'}}
15 // expected-note@+1 {{'__builtin_va_end' is a builtin with type}}
16 void __builtin_va_end(__builtin_va_list);
17 // RUN: %clang_cc1 %s -fsyntax-only -verify
18 // RUN: %clang_cc1 %s -fsyntax-only -verify -x c
20 void __va_start(__builtin_va_list*, ...);
22 #ifdef __cplusplus
23 void *__builtin_assume_aligned(const void *, size_t, ...) noexcept;
24 #else
25 void *__builtin_assume_aligned(const void *, size_t, ...);
26 #endif