Checking of multiversion function declarations performed by various functions
in clang/lib/Sema/SemaDecl.cpp previously forced the valus of a passed in
'MergeTypeWithPrevious' reference argument in several scenarios. This was
unnecessary and possibly incorrect in the one case that the value
was forced to 'true' (though seemingly unobservably so).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
You should fix the clang-format issues (I leave @erichkeane to sign off on this one, but it looks reasonable to me).
Hmm... my understanding is "MergeTypeWithPrevious" is important for cases where we decide that this is a redeclaration, right? We need to set it to 'false' when we "know" that this is a different declaration, right? So at least the '=false' was correct?
Hmm... my understanding is "MergeTypeWithPrevious" is important for cases where we decide that this is a redeclaration, right? We need to set it to 'false' when we "know" that this is a different declaration, right? So at least the '=false' was correct?
As best as I can tell, MergeTypeWithPrevious is only true when 1) compiling as C, 2) the previous declaration (if any) is not shadowed, and 3) there is no visible previous declaration and there is a conflicting non-visible declaration. When already set to true, setting it to false would likely defeat some later diagnostics.
I spent a while trying to intuit a test that demonstrated different behavior before and after this change and wasn't able to identify one.
Ok then, I seem to then just not understand its purpose, but you seem to understand it well enough. I'm ok with this patch now (after the format fixes!).
clang-format: please reformat the code