[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 05:10:20 PST 2019


martong added a comment.

In D70819#1777770 <https://reviews.llvm.org/D70819#1777770>, @shafik wrote:

> Apologies for wacky C++ code that follows but will this also work for the following cases:
>
>   auto f2() { 
>     auto l = []() {
>         struct X{};
>         return X();
>     };
>    return l(); 
>    }
>  
>    auto f3() { 
>     if ( struct X{} x; true) 
>         return X();
>     else return X();    
>    }
>  
>    auto f4() {
>       for(struct X{} x;;)
>          return X();
>    }
>  
>    auto f5() {
>       switch(struct X{} x; 10) {
>         case 10:
>          return X();
>       }
>    }
>
>
> godbolt live example <https://godbolt.org/z/_SXcje>


Thanks for these cases! I am going to write unit tests for these as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70819/new/

https://reviews.llvm.org/D70819





More information about the cfe-commits mailing list