This revision was automatically updated to reflect the committed changes.
Closed by commit rL305812: Fix for Bug 33471: Preventing operator auto from
resolving to a template… (authored by erichkeane).
Changed prior to commit:
https://reviews.llvm.org/D34370?vs=103224&id=103235#toc
Repository:
erichkeane added inline comments.
Comment at: lib/Sema/SemaLookup.cpp:870
+ DeclarationName::CXXConversionFunctionName &&
+ R.getLookupName().getCXXNameType()->getContainedDeducedType() &&
+ R.getLookupName()
rsmith wrote:
> Maybe only call thi
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Looks good, thanks!
Comment at: lib/Sema/SemaLookup.cpp:870
+ DeclarationName::CXXConversionFunctionName &&
+ R.getLookupName().getCXXNameType()->getContainedDe
erichkeane updated this revision to Diff 103224.
erichkeane marked an inline comment as done.
erichkeane added a comment.
Hi @rsmith
Thanks for the quick response! I spent a while going over it, and think I have
what you were looking for. I Also added the operator auto * tests.
https://revie
rsmith added inline comments.
Comment at: lib/Sema/SemaLookup.cpp:870-872
+auto *Ty =
+dyn_cast(R.getLookupName().getCXXNameType());
+if (Ty && Ty->isUndeducedType())
This is not sufficient to catch cases such as `operator auto*`, and one day
the
erichkeane created this revision.
As the bug report says,
struct A
{
template operator T();
};
void foo()
{
A().operator auto();
}
causes: "undeduced type in IR-generation
UNREACHABLE executed at llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:208!"
The problem is that in this case, "T