summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index ecb25c92e2f..df73f3607ce 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -390,8 +390,12 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
- auto clang_ast_ctx = llvm::dyn_cast_or_null<ClangASTContext>(
- symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus));
+ auto clang_ast_ctx_or_err =
+ symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
+ ASSERT_THAT_EXPECTED(clang_ast_ctx_or_err, llvm::Succeeded());
+
+ auto clang_ast_ctx =
+ llvm::dyn_cast_or_null<ClangASTContext>(&clang_ast_ctx_or_err.get());
EXPECT_NE(nullptr, clang_ast_ctx);
EXPECT_EQ(1u, symfile->FindTypes(ConstString("Class"), nullptr, false, 0,
@@ -440,8 +444,12 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
- auto clang_ast_ctx = llvm::dyn_cast_or_null<ClangASTContext>(
- symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus));
+ auto clang_ast_ctx_or_err =
+ symfile->GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
+ ASSERT_THAT_EXPECTED(clang_ast_ctx_or_err, llvm::Succeeded());
+
+ auto clang_ast_ctx =
+ llvm::dyn_cast_or_null<ClangASTContext>(&clang_ast_ctx_or_err.get());
EXPECT_NE(nullptr, clang_ast_ctx);
auto ast_ctx = clang_ast_ctx->getASTContext();
OpenPOWER on IntegriCloud