]> granicus.if.org Git - clang/commit
Fix for Bug 33471: Preventing operator auto from resolving to a template operator.
authorErich Keane <erich.keane@intel.com>
Tue, 20 Jun 2017 17:38:07 +0000 (17:38 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 20 Jun 2017 17:38:07 +0000 (17:38 +0000)
commitc35b73c765d276f2433f2f89229022e5f08b003c
tree9abde6dfde542bb63721d996cc1172c762144795
parentf5f37badaf42c9f95d12cedd7d097cf7673c8817
Fix for Bug 33471: Preventing operator auto from resolving to a template operator.

As the bug report says,
struct A
{

  template<typename T> 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" is being deduced as "auto",
which I believe is incorrect.

The 'operator auto' implementation in Clang is standards compliant, however
there is a defect report against core (1670).

Differential Revision: https://reviews.llvm.org/D34370

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305812 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaLookup.cpp
test/SemaCXX/cxx1y-deduced-return-type.cpp