Clang Project

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