Home | History | Annotate | Download | only in dcl.fct.spec
      1 // RUN: %clang_cc1 -verify %s
      2 
      3 class A {
      4 public:
      5   explicit A();
      6 
      7   explicit operator int(); // expected-warning {{explicit conversion functions are a C++11 extension}}
      8 
      9   explicit void f0(); // expected-error {{'explicit' can only be applied to a constructor or conversion function}}
     10 
     11   operator bool();
     12 };
     13 
     14 explicit A::A() { } // expected-error {{'explicit' can only be specified inside the class definition}}
     15 explicit A::operator bool() { return false; }  // expected-warning {{explicit conversion functions are a C++11 extension}}\
     16                                                // expected-error {{'explicit' can only be specified inside the class definition}}
     17 
     18 class B {
     19   friend explicit A::A(); // expected-error {{'explicit' is invalid in friend declarations}}
     20 };
     21