xref: /llvm-project/clang/test/AST/function-alias.cpp (revision 84dcc8f36fe20c071e731e6f943ed49872291eba)
1*84dcc8f3SStephan Bergmann // RUN: %clang_cc1 -std=c++17 -fsyntax-only %s
2*84dcc8f3SStephan Bergmann 
3*84dcc8f3SStephan Bergmann // Verify that ASTContext::getFunctionTypeWithExceptionSpec (called through
4*84dcc8f3SStephan Bergmann // ASTContext::hasSameFunctionTypeIgnoringExceptionSpec from
5*84dcc8f3SStephan Bergmann // ExprEvaluatorBase::handleCallExpr in lib/AST/ExprConstant.cpp) does not crash
6*84dcc8f3SStephan Bergmann // for a type alias.
7*84dcc8f3SStephan Bergmann 
f()8*84dcc8f3SStephan Bergmann constexpr int f() noexcept { return 0; }
9*84dcc8f3SStephan Bergmann 
10*84dcc8f3SStephan Bergmann using F = int();
11*84dcc8f3SStephan Bergmann 
g(F * p)12*84dcc8f3SStephan Bergmann constexpr int g(F * p) { return p(); }
13*84dcc8f3SStephan Bergmann 
14*84dcc8f3SStephan Bergmann constexpr int n = g(f);
15