llvm-project
llvm-project copied to clipboard
Missing diagnostic for data member redeclaration with using-declaration involving virtual inheritance
The following code is not diagnosed by Clang trunk:
struct Base {
int k;
};
struct A : virtual Base { };
struct B : virtual Base { };
struct T : A, B {
using A::k, B::k;
};
Clang invocation:
$ clang -std=c++17 -fsyntax-only test.cc
I think the code is ill-formed according to C++17 [namespace.udecl]/10: "A using-declaration is a declaration and can therefore be used repeatedly where (and only where) multiple declarations are allowed."
GCC rejects this code:
<source>:10:20: error: redeclaration of 'using B::k'
10 | using A::k, B::k;
| ^
<source>:10:14: note: previous declaration 'using A::k'
10 | using A::k, B::k;
| ^
Compiler returned: 1
@llvm/issue-subscribers-clang-frontend
@llvm/issue-subscribers-c-1
Any progress on this?
Nope - https://godbolt.org/z/8TKxs18dx.