https://bugs.llvm.org/show_bug.cgi?id=51134
Bug ID: 51134
Summary: Can't access private static variable template from a
friend class, in the type of a static variable
template
Product: clang
Version: 12.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]
Example code:
```
class A
{
friend struct B;
template <typename>
static constexpr int x = 42;
};
struct B
{
template <typename U>
static constexpr decltype(A::template x<U>) y = 43;
};
int main()
{
(void)B::y<int>;
}
```
This gives me `error: 'x' is a private member of 'A'`.
Removing template-ness from either variable fixes the issue. Accessing `x` from
the initializer of `y` (rather than from its type) also works.
--
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