diff options
author | Andrey Ali Khan Bolshakov <bolsh.andrey@yandex.ru> | 2024-05-24 23:04:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-24 13:04:18 -0700 |
commit | 6be1a1535ef4ea30f301586e4960bebbfccfe851 (patch) | |
tree | 0e882fd1500d99f74f897c7c1f7f58faf8de37b8 /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 2669ee117422e0a2ece69ab33c2f8d97a5c7d85a (diff) | |
download | llvm-6be1a1535ef4ea30f301586e4960bebbfccfe851.zip llvm-6be1a1535ef4ea30f301586e4960bebbfccfe851.tar.gz llvm-6be1a1535ef4ea30f301586e4960bebbfccfe851.tar.bz2 |
[clang][c++20] Fix code coverage mapping crash with generalized NTTPs (#85837)
Introduced in #78041, originally reported as #79957 and fixed partially
in #80050.
`OpaqueValueExpr` used with `TemplateArgument::StructuralValue` has no
corresponding source expression.
A test case with subobject-referring NTTP added.
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index 05de50e..6ce2d32 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -2271,7 +2271,8 @@ struct CounterCoverageMappingBuilder } void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) { - Visit(OVE->getSourceExpr()); + if (OVE->isUnique()) + Visit(OVE->getSourceExpr()); } }; |