3

Why does this not compile with gcc/msvc? clang is happy and hopefully right.

#include <type_traits>
extern const int s1;
static_assert(std::is_same_v<decltype(s1),int const>);
auto  const s1 = int{42};
static_assert(std::is_same_v<decltype(s1),int const>);
bolov
  • 72,283
  • 15
  • 145
  • 224
user3721426
  • 273
  • 2
  • 8

0 Answers0