Which compiler is right - or is this a defect in the standard?
GCC compiles the following code, but clang complains:
<source>:20:7: error: 'Impl' is a protected member of 'A'
Code:
template<typename T>
struct WrapperBuilder;
template <typename T>
struct LetMeIn : public T {
friend struct WrapperBuilder<T>;
};
class A {
protected:
struct Impl;
};
// without this line, gcc complains too (but I think I understand why)
extern template struct LetMeIn<A>;
template<>
struct WrapperBuilder<A> {
A::Impl * i; // Clang doesn't like this line
};
Thank you.
Also, anyone know a workaround for clang that doesn't involve changing A?