Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22233

Why do gcc and clang generate different symbol names for an instantiation of a function template?

$
0
0

Consider the following example:

struct A {  using type = int;};template <typename T>using B = A;template <typename T>typename B<T>::type f() { return {}; }template B<int>::type f<int>();

Clang generates symbol named int f<int>() while GCC generates B::type f<int>() for the instantiation: https://godbolt.org/z/MCCza4

Why don't the compilers agree and shouldn't GCC also resolve B::type to int?


Viewing all articles
Browse latest Browse all 22233

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>