1 // RUN: %clang_cc1 -verify %s
2 // RUN: %clang_cc1 -verify -std=c++98 %s
3 // RUN: %clang_cc1 -verify -std=c++11 %s
9 explicit operator int();
10 #if __cplusplus <= 199711L // C++03 or earlier modes
11 // expected-warning@-2 {{explicit conversion functions are a C++11 extension}}
14 explicit void f0(); // expected-error {{'explicit' can only be applied to a constructor or conversion function}}
19 explicit A::A() { } // expected-error {{'explicit' can only be specified inside the class definition}}
20 explicit A::operator bool() { return false; }
21 #if __cplusplus <= 199711L // C++03 or earlier modes
22 // expected-warning@-2 {{explicit conversion functions are a C++11 extension}}
24 // expected-error@-4 {{'explicit' can only be specified inside the class definition}}
27 friend explicit A::A(); // expected-error {{'explicit' is invalid in friend declarations}}