xref: /llvm-project/clang/test/SemaCXX/placement-new-builtin.cpp (revision af0ee617fc5f69051297b0c23f8c818b20f02c3a)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2 
3 struct S {
4   void* operator new(__SIZE_TYPE__, char*);
5   void* operator new(__SIZE_TYPE__, __SIZE_TYPE__);
6 };
7 
main()8 int main() {
9   new (__builtin_strchr) S; // expected-error {{builtin functions must be directly called}}
10   new ((__builtin_strlen)) S; // expected-error {{builtin functions must be directly called}}
11 }
12