[PATCH] D46684: [Frontend] Don't skip function body when the return type is dependent on the template parameter.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 11 07:20:46 PDT 2018


ilya-biryukov added inline comments.


================
Comment at: lib/Sema/SemaDecl.cpp:12645
+    if (FD->isConstexpr() || FD->getReturnType()->isUndeducedType() ||
+        FD->getReturnType()->isInstantiationDependentType())
       return false;
----------------
rsmith wrote:
> This is a lot broader than necessary; what we should do is to look for a deduced type in the return type. `isUndeducedType` doesn't quite do that for a template because we "deduce" the `auto` as a dependent type early.
My change from some time ago (D44480) seem to do exactly that. Could you take a look?


Repository:
  rC Clang

https://reviews.llvm.org/D46684





More information about the cfe-commits mailing list