Skip to content

Missing "no return statement in constexpr function" error for a templated constexpr function #63617

Closed
@strimo378

Description

@strimo378

Hi all,

I found a case where clang issues a warning about "non-void function does not return a value" for a constexpr function. For constexpr function, clang typically issues an error and no warning.

The code to generate the warning is

template <class...> struct a {};
template <class... b> constexpr a<typename b ::c...> d() {}
auto e = d();

//constexpr int f() {}

Or a link to compiler explorer https://godbolt.org/z/1rd4W8exr

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconstevalC++20 constevalquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions