https://github.com/jyknight commented:

FTR, running the provided test with current clang results in the following 
assertion error:
```
clang: clang/lib/Sema/SemaTemplateInstantiate.cpp:4772: llvm::PointerUnion<Decl 
*, LocalInstantiationScope::DeclArgumentPack *> 
*clang::LocalInstantiationScope::findInstantiationOf(const Decl *): Assertion 
`isa<LabelDecl>(D) && "declaration not instantiated in this scope"' failed.
```

I'm not really knowledgeable enough about Clang AST to appropriately review 
this change, but I commented on one problem in it.

I also note that this depends on the imported functions always having exactly 
the same local decls within the function body, so that mapping by index can 
work. I _think_ that is correct to assume, since we do ODR hashing of the ASTs 
on imports and raise an error if they mismatch. But seemed worth pointing out 
explicitly, in case there's some edge case where that isn't true I don't know 
about. (And the existing mapping only happens on params, which I think are 
_more_ guaranteed-equal.)


https://github.com/llvm/llvm-project/pull/202248
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to