xref: /aosp_15_r20/external/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2*67e74705SXin Li 
3*67e74705SXin Li void f(); // expected-note {{possible target for call}}
4*67e74705SXin Li void f(int); // expected-note {{possible target for call}}
5*67e74705SXin Li 
g()6*67e74705SXin Li void g() {
7*67e74705SXin Li   bool b = noexcept(f); // expected-error {{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}}
8*67e74705SXin Li   bool b2 = noexcept(f(0));
9*67e74705SXin Li }
10*67e74705SXin Li 
11*67e74705SXin Li struct S {
12*67e74705SXin Li   void g(); // expected-note {{possible target for call}}
13*67e74705SXin Li   void g(int); // expected-note {{possible target for call}}
14*67e74705SXin Li 
hS15*67e74705SXin Li   void h() {
16*67e74705SXin Li     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*67e74705SXin Li     bool b2 = noexcept(this->g(0));
18*67e74705SXin Li   }
19*67e74705SXin Li };
20