Skip to content

Undefined reference to index_tag<0ul> on clang 17 #54

@nikhilkalige

Description

@nikhilkalige

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions