decltype for lambda capture gives wrong type #37673
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
invalid
Resolved as invalid, i.e. not a bug
Extended Description
According to my reading of the http://eel.is/c++draft/expr.prim.id.unqual#2 the following code should compile:
#include <type_traits>
#include
constexpr std::true_type is_const(int const &) { return {}; }
constexpr std::false_type is_const(int &) { return {}; }
int main() {
int x = 0;
[y = x, x] {
const int z = 0;
assert(is_const(x)); // OK
assert(is_const(y)); // OK
assert(is_const(z)); // OK
} ();
}
However, two lines marked with "Fails (OK on GCC)" do not pass the asserts.
The text was updated successfully, but these errors were encountered: