Skip to content

clang incorrectly accepts non-constant consteval function calls in destructor #109096

Open
@kelbon

Description

@kelbon

https://godbolt.org/z/MzaPMraqK

This code incorrectly produces runtime error instead of compilation error in checking fmt::format string

#include <fmt/core.h>

template<typename T>
struct scope_exit {
   T val;
constexpr ~scope_exit() {  val(); }
};

int main() {
  scope_exit x([]() { std::string s = fmt::format("{}"); });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions