https://github.com/Endilll requested changes to this pull request.

This fix doesn't make any sense to me. Why are we even looking at function 
parameters?
I suspect the only reason it works is because not setting `Invalid` to `true` 
introduces this invalid declaration to the redeclaration chain, which has 
consequences (I left one of the comments suggesting an additional test).

I can imagine two approaches to resolve the original issue:
1. Allow invalid declarations (with bogus `inline`) into redeclaration chains. 
Honestly, I don't know if we already do this elsewhere, and whether we want to 
use this approach here.
2. During overload resolution, be more wary of candidates that come from 
invalid declaration. For instance, add a round of overload resolution without 
candidates from invalid decls before the already existing round . This, of 
course, can have significant consequences on the quality of diagnostics in 
general, not just for this issue.

In either approach we woudn't need to reach out for lexical context or 
parameters: this is just between redeclarations of a function.

CC @AaronBallman 

https://github.com/llvm/llvm-project/pull/199239
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to