[Bug c++/102170] New: False accept of class member access using qualified-id in case of ambiguity
fchelnokov at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Sep 2 06:41:02 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102170
Bug ID: 102170
Summary: False accept of class member access using qualified-id
in case of ambiguity
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
In this program there is an ambiguity in qualified-id member access .D::
```
template<int N> struct A{ int v = N; using D = A; };
struct B : A<1>, A<2> {};
using D = A<1>;
int main() { return B{}.D::v; }
```
This program must be rejected (as Clang does). But GCC accepts it now,
incorrectly using global D
https://gcc.godbolt.org/z/74qraoeac
More information about the Gcc-bugs
mailing list