https://bugs.llvm.org/show_bug.cgi?id=42348
Bug ID: 42348
Summary: Invalid private member diagnostic of template using
with decltype of private member method
Product: clang
Version: trunk
Hardware: All
OS: All
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]
The following code fails to compile with an erroneous error "'Impl' is a
private member of 'S<void>'":
template <typename> struct S
{
private:
template <typename> static constexpr auto Impl();
public:
template <typename X> using U = decltype(Impl<X>());
};
template <typename T> template <typename>
constexpr auto S<T>::Impl() { }
using X = S<void>::U<void>;
The above code compiles in gcc et al. Making the following change allows
compilation:
template <typename> struct S
{
private:
struct W
{
template <typename> static constexpr auto Impl();
};
public:
template <typename X> using U = decltype(W::template Impl<X>());
};
template <typename T> template <typename>
constexpr auto S<T>::W::Impl()
{ }
--
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