[PATCH] D98068: Remove asserts for LocalInstantiationScope

2021-06-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping I will provide a detailed description of the issue: What happen are: First, fun1 is instantiated as `fun1<0,1>`, which calls lambda function `f(f, Number<1>)`. This causes lambda function `f` instantiated as `f(f, Number<1>)`. clang uses LocalInstantiationScope

[PATCH] D98068: Remove asserts for LocalInstantiationScope

2021-03-08 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Godbolt appears to be OK with the code for both gcc and clang: https://godbolt.org/z/enec44 Debug build does assert here: clang++: /work/llvm/repo/clang/lib/Sema/SemaTemplateInstantiate.cpp:3630: void clang::LocalInstantiationScope::InstantiatedLocal(const clang::Decl

[PATCH] D98068: Remove asserts for LocalInstantiationScope

2021-03-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rsmith, rjmccall, tra. yaxunl requested review of this revision. A lambda in a function template may be recursively instantiated as the following example: template struct Number { static constexpr unsigned value = v; };