https://bugs.llvm.org/show_bug.cgi?id=42125

            Bug ID: 42125
           Summary: Cannot use alias template in friend declaration
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Hi,

trying to use an alias template in a friend declaration fails with "error:
redefinition of 'XYZ' as different kind of symbol".

This piece of code fails to compile on clang-8:
~~~
template<typename T>
class ActualStuff {};

template <typename B>
class Other {
public:
    template<typename T>
    using Stuff = ActualStuff<T>;

#if 1
    // this fails with:
    // error: redefinition of 'Stuff' as different kind of symbol
    template<typename>
    friend class Stuff;
#else
    // this works
    template<typename>
    friend class ActualStuff;
#endif
};
~~~

And the only way I found to make it work (as shown in the example) is to bypass
the alias.

As a side note, gcc accepts the code in the example.

Cheers
Marco

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to