xref: /minix3/external/bsd/llvm/dist/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc void f(); // expected-note {{possible target for call}}
4*0a6a1f1dSLionel Sambuc void f(int); // expected-note {{possible target for call}}
5*0a6a1f1dSLionel Sambuc 
g()6*0a6a1f1dSLionel Sambuc void g() {
7*0a6a1f1dSLionel Sambuc   bool b = noexcept(f); // expected-error {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}}
8*0a6a1f1dSLionel Sambuc   bool b2 = noexcept(f(0));
9*0a6a1f1dSLionel Sambuc }
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc struct S {
12*0a6a1f1dSLionel Sambuc   void g(); // expected-note {{possible target for call}}
13*0a6a1f1dSLionel Sambuc   void g(int); // expected-note {{possible target for call}}
14*0a6a1f1dSLionel Sambuc 
hS15*0a6a1f1dSLionel Sambuc   void h() {
16*0a6a1f1dSLionel Sambuc     bool b = noexcept(this->g); // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}}
17*0a6a1f1dSLionel Sambuc     bool b2 = noexcept(this->g(0));
18*0a6a1f1dSLionel Sambuc   }
19*0a6a1f1dSLionel Sambuc };
20