bolt/deps/llvm-18.1.8/clang/test/SemaCXX/placement-new-builtin.cpp
2025-02-14 19:21:04 +01:00

11 lines
368 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
struct S {
void* operator new(__SIZE_TYPE__, char*);
void* operator new(__SIZE_TYPE__, __SIZE_TYPE__);
};
int main() {
new (__builtin_strchr) S; // expected-error {{builtin functions must be directly called}}
new ((__builtin_strlen)) S; // expected-error {{builtin functions must be directly called}}
}