aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/placement-new-builtin.cpp
blob: 5776a94dc3ad8196511d714588c79d8537111033 (plain)
1
2
3
4
5
6
7
8
9
10
11
// 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}}
}