// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++11 -faligned-allocation -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++14 -faligned-allocation -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++17 -faligned-allocation -fsyntax-only -verify %s
// namespace std
void *operator new ; // #1
;
void *
void *
void * // expected-warning {{requested alignment is not a power of 2}}
;
void *
void *
void *
void *
std::align_val_t
std::align_val_t
std::align_val_t
;
void *operator new; // #2
void *operator new; // #3
// FIXME: Consider improving notes 1 and 3 here to say that these are aligned
// allocation functions and the type is not over-aligned.
X *p = new X; // expected-error {{no matching function}}
// expected-note@#1 {{no known conversion from 'int' to 'std::align_val_t' for 2nd argument}}
// expected-note@#2 {{no known conversion from 'int' to 'X' for 2nd argument}}
// expected-note@#3 {{requires 3 arguments}}
// expected-note@* {{requires 1 argument, but 2 were provided}} (builtin)
;
Y *q = new Y; // expected-error {{no matching function}}
// expected-note@#1 {{requires 2 arguments, but 3 were provided}}
// expected-note@#2 {{no known conversion from 'int' to 'X' for 2nd argument}}
// expected-note@#3 {{no known conversion from 'int' to 'X' for 3rd argument}}
// expected-note@* {{requires 1 argument, but 2 were provided}} (builtin)
X *r = new X; // expected-error {{no matching function}}
// expected-note@#1 {{requires 2 arguments, but 3 were provided}}
// expected-note@#2 {{requires 2 arguments, but 3 were provided}}
// expected-note@#3 {{no known conversion from 'int' to 'X' for 3rd argument}}
// expected-note@* {{requires 1 argument, but 3 were provided}} (builtin)