I was playing around with constexpr when I found that GCC rejected this seemingly valid code:
#include <functional>
constexpr void test(const std::function<void()>& a) {
a();
}
int main() {
test([](){});
}
I went to godbolt, and clang happens to compile this code fine. Is this a bug in GCC? Here is the godbolt link