intopen(constchar*pathname,intflags)__attribute__((enable_if(!(flags&O_CREAT),"must specify mode when using O_CREAT")))__attribute__((overloadable));// expected-note{{candidate disabled: must specify mode when using O_CREAT}}
intopen(constchar*pathname,intflags,mode_tmode)__attribute__((overloadable));// expected-note{{candidate function not viable: requires 3 arguments, but 2 were provided}}
voidtest1(){
#ifndef CODEGEN
open("path",O_CREAT);// expected-error{{no matching function for call to 'open'}}
voidf(intn)__attribute__((enable_if(unresolvedid,"chosen when 'unresolvedid' is non-zero")));// expected-error{{use of undeclared identifier 'unresolvedid'}}
intglobal;
voidf(intn)__attribute__((enable_if(global==0,"chosen when 'global' is zero")));// expected-error{{'enable_if' attribute expression never produces a constant expression}} // expected-note{{subexpression not valid in a constant expression}}
constintcst=7;
voidreturn_cst(void)__attribute__((overloadable))__attribute__((enable_if(cst==7,"chosen when 'cst' is 7")));
void(*p1)(void)=&f2;// expected-error{{initializing 'void (*)(void)' with an expression of incompatible type '<overloaded function type>'}} expected-note@121{{candidate function}} expected-note@122{{candidate function made ineligible by enable_if}} expected-note@123{{candidate function}}
void(*p2)(void)=f2;// expected-error{{initializing 'void (*)(void)' with an expression of incompatible type '<overloaded function type>'}} expected-note@121{{candidate function}} expected-note@122{{candidate function made ineligible by enable_if}} expected-note@123{{candidate function}}
void*p3=(void*)&f2;// expected-error{{address of overloaded function 'f2' is ambiguous}} expected-note@121{{candidate function}} expected-note@122{{candidate function made ineligible by enable_if}} expected-note@123{{candidate function}}
void*p4=(void*)f2;// expected-error{{address of overloaded function 'f2' is ambiguous}} expected-note@121{{candidate function}} expected-note@122{{candidate function made ineligible by enable_if}} expected-note@123{{candidate function}}
void(*p1)(int)=&f3;// expected-error{{initializing 'void (*)(int)' with an expression of incompatible type '<overloaded function type>'}} expected-note@131{{candidate function made ineligible by enable_if}} expected-note@132{{candidate function made ineligible by enable_if}}
void(*p2)(int)=f3;// expected-error{{initializing 'void (*)(int)' with an expression of incompatible type '<overloaded function type>'}} expected-note@131{{candidate function made ineligible by enable_if}} expected-note@132{{candidate function made ineligible by enable_if}}
void*p3=(void*)&f3;// expected-error{{address of overloaded function 'f3' does not match required type 'void'}} expected-note@131{{candidate function made ineligible by enable_if}} expected-note@132{{candidate function made ineligible by enable_if}}
void*p4=(void*)f3;// expected-error{{address of overloaded function 'f3' does not match required type 'void'}} expected-note@131{{candidate function made ineligible by enable_if}} expected-note@132{{candidate function made ineligible by enable_if}}