sdkrystian wrote:

@erichkeane PR updated. 

When we encounter a class member access expression with a nested-name-specifier 
that is invalid, should we simply ignore it and instead use the type of the 
object expression as the lookup context? This is the current behavior, but it 
leads to lots of duplicate diagnostics. For example:
```cpp
struct A
{
    using I = int;
};

void f(A* x)
{
    x->I::z; // error: 'A::I' (aka 'int') is not a class, namespace, or 
enumeration
               // error: no member named 'z' in 'A'
}
```
IMO we should just return `ExprError` from `BuildMemberReferenceExpr` and thus 
not emit the second error.

https://github.com/llvm/llvm-project/pull/84050
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to