[libc][NFC] Remove extra ; in exhaustive_test.h. (#124216)
[llvm-project.git] / clang / test / CXX / dcl.dcl / dcl.spec / dcl.fct.spec / p6.cpp
blob08b22c118685a9ad249080cc55daa433a5597d82
1 // RUN: %clang_cc1 -verify %s
2 // RUN: %clang_cc1 -verify -std=c++98 %s
3 // RUN: %clang_cc1 -verify -std=c++11 %s
5 class A {
6 public:
7 explicit A();
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}}
12 #endif
14 explicit void f0(); // expected-error {{'explicit' can only be applied to a constructor or conversion function}}
16 operator bool();
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}}
23 #endif
24 // expected-error@-4 {{'explicit' can only be specified inside the class definition}}
26 class B {
27 friend explicit A::A(); // expected-error {{'explicit' is invalid in friend declarations}}