Skip to content

Commit e9896d2

Browse files
authored
Ensure CheckTemplateArgumentList is always called with a non-empty CodeSynthesisContext (#202)
Fixes an internal Clang assertion failure triggered when preprocessing the rules for `std::unique_ptr` with `--cxxflags='-stdlib=libc++'`.
1 parent b48802c commit e9896d2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cpp2rust/cpp_rule_preprocessor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ class Callback : public clang::ast_matchers::MatchFinder::MatchCallback {
270270

271271
clang::DefaultArguments defaultArgs;
272272
clang::Sema::CheckTemplateArgumentInfo ctai;
273+
clang::Sema::InstantiatingTemplate Inst(*sema_, loc_, decl);
273274
auto invalid = sema_->CheckTemplateArgumentList(
274275
decl, decl->getTemplateParameters(), loc_, targsInfo, defaultArgs,
275276
true, ctai);

0 commit comments

Comments
 (0)