clang above v17 throws an error during linking.
int main() {
nonstd::variant< char, int, long, std::string > var;
var = 'v' ;
return 0;
}
/opt/compiler-explorer/gcc-13.2.0/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../x86_64-linux-gnu/bin/ld: /tmp/example-480496.o:(.debug_addr+0x20): undefined reference to `void nonstd::variants::detail::index_tag<0ul>(nonstd::variants::detail::index_tag_t<0ul>)'
I compiled with clang 16 which works and compare the output of the object files from clang 17. The only different between the two is below
Clang-16 0000000000000000 W void nonstd::variants::detail::index_tag<0ul>(nonstd::variants::detail::index_tag_t<0ul>)
Clang-17 U void nonstd::variants::detail::index_tag<0ul>(nonstd::variants::detail::index_tag_t<0ul>)
https://godbolt.org/z/fcY571qs7
clang above v17 throws an error during linking.
I compiled with clang 16 which works and compare the output of the object files from clang 17. The only different between the two is below
https://godbolt.org/z/fcY571qs7