[PATCH] D44480: [Sema] Don't skip function bodies with 'auto' without trailing return type

Ilya Biryukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 02:58:02 PDT 2018


ilya-biryukov added a comment.

In https://reviews.llvm.org/D44480#1117230, @nik wrote:

> In https://reviews.llvm.org/D44480#1117147, @cpplearner wrote:
>
> > Does `getAs<AutoType>()` work correctly with function returning `auto&`?
>
>
> the "getAs<AutoType>()" version will skip the function body and generate an error message on use, but "FD->getReturnType()->getContainedDeducedType()" works fine (will not skip the body, as it should here). OK, so now I have a rough idea what the "Contained" was referring too :)


Yep, `getContainedDeducedType()` call is definitely necessary. Added the tests for discussed cases in https://reviews.llvm.org/rL333735.


Repository:
  rL LLVM

https://reviews.llvm.org/D44480





More information about the llvm-commits mailing list