================
@@ -3859,6 +3859,33 @@ TEST(TransferTest, StaticCastBaseToDerivedUnknown) {
});
}
+TEST(TransferTest, StaticCastBaseToDerivedWithSyntheticFieldsNoModeledFields) {
+ std::string Code = R"cc(
+ struct Base {};
+ struct Derived : public Base {};
+ void target(Base* BPtr) {
+ Derived* DPtr = static_cast<Derived*>(BPtr);
+ (void)DPtr;
+ // [[p]]
+ }
+ )cc";
+ ASSERT_THAT_ERROR(
+ checkDataflowWithNoopAnalysis(
+ Code, ast_matchers::hasName("target"),
+ [](const llvm::StringMap<DataflowAnalysisState<NoopLattice>>
&Results,
+ ASTContext &ASTCtx) {
+ ASSERT_THAT(Results.keys(), UnorderedElementsAre("p"));
----------------
jvoung wrote:
Is there any more checking of the Results that would make sense here?
Or leave a comment that not crashing is enough.
https://github.com/llvm/llvm-project/pull/208726
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits