When a variable is defined in the init capture and it is of type struct that is dependent on additional structure, its definition is not found. An exception is created in the findInstantiatedDecl () function.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
Hi Balaji,
Can you try to manually reduce the attached testcase? Its really difficult to understand exactly what is actually happening here, and why your fix is correct, without having a minimal reproducer. Ideally there would just be a few decls that succinctly demonstrate what the problem is.
Thanks!
test/SemaCXX/lambda-init-capture-vardefine.cpp | ||
---|---|---|
4 | These kinds of tests that don't check for any output are a bit dangerous, because they will also succeed if clang is symlinked to /bin/true. |
Simplified the case a bit more as requested by Erik. I also induced some errors in the test so that if someone symbolic-linked clang to /bin/true, the test will fail.
lib/Sema/SemaTemplateInstantiate.cpp | ||
---|---|---|
2916–2918 | Why are we failing to find the instantiation of the VarDecl in this case? It seems to me like we should of picked it up in the for loop above. Is it not getting added to the LocalInstantiationScope? Or are we looking in the wrong LocalInstantiationScope? |
Why are we failing to find the instantiation of the VarDecl in this case? It seems to me like we should of picked it up in the for loop above. Is it not getting added to the LocalInstantiationScope? Or are we looking in the wrong LocalInstantiationScope?