[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-12 Thread Hans Wennborg via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa088766508aa: [dllexport] Instantiate default ctor default args for explicit specializations… (authored by hans). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-12 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment. >> I don't think it makes sense to try to emit the closure until we have the >> ctor definition. I'll update the patch to handle this. > > Ok. That's a bit different than what MSVC is doing. It generates a closure > constructor even if there is only a declaration. But I gue

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. In D91089#2385821 , @hans wrote: >> clang.exe -c test.cpp >> Assertion failed: !hasUninstantiatedDefaultArg() && "Default argument is not >> yet instantiated!", file >> D:\IUSERS\zahiraam\llorg_ws\ws1\llvm\clang\lib\AST\Decl.cpp

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-10 Thread Hans Wennborg via Phabricator via cfe-commits
hans updated this revision to Diff 304190. hans added a comment. Handling the decl only case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91089/new/ https://reviews.llvm.org/D91089 Files: clang/include/clang/Sema/Sema.h clang/lib/CodeGen/MicrosoftCXXABI.cpp clang/lib/Sema/SemaD

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-10 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment. > clang.exe -c test.cpp > Assertion failed: !hasUninstantiatedDefaultArg() && "Default argument is not > yet instantiated!", file > D:\IUSERS\zahiraam\llorg_ws\ws1\llvm\clang\lib\AST\Decl.cpp, line 2719 > PLEASE submit a bug report to https://bugs.llvm.org/ and include the

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. In D91089#2383433 , @hans wrote: > Please take a look. @hans Thanks for looking at this. This test case is still crashing with the patch: ksh-3.2$ cat test.cpp template class __declspec(dllexport) foo { foo(int x = 0); };

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-09 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment. Please take a look. Comment at: clang/lib/Sema/SemaDecl.cpp:13996 } + if (auto *Ctor = dyn_cast(FD)) { I was searching for the right place to do this, looking mostly in the sema template code, but ended up here as an explicit specia

[PATCH] D91089: [dllexport] Instantiate default ctor default args for explicit specializations (PR45811)

2020-11-09 Thread Hans Wennborg via Phabricator via cfe-commits
hans created this revision. hans added reviewers: rnk, zahiraam. Herald added a project: clang. hans requested review of this revision. For dllexported default constructors with default arguments, we export default constructor closures which pass in the default args. (See D8331