aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInstanceTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Frontend/CompilerInstanceTest.cpp')
-rw-r--r--clang/unittests/Frontend/CompilerInstanceTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/unittests/Frontend/CompilerInstanceTest.cpp b/clang/unittests/Frontend/CompilerInstanceTest.cpp
index 6e9a6f5..a7b258d 100644
--- a/clang/unittests/Frontend/CompilerInstanceTest.cpp
+++ b/clang/unittests/Frontend/CompilerInstanceTest.cpp
@@ -53,9 +53,10 @@ TEST(CompilerInstance, DefaultVFSOverlayFromInvocation) {
const std::string VFSArg = "-ivfsoverlay" + FileNameStr;
const char *Args[] = {"clang", VFSArg.c_str(), "-xc++", "-"};
+ DiagnosticOptions DiagOpts;
IntrusiveRefCntPtr<DiagnosticsEngine> Diags =
CompilerInstance::createDiagnostics(*llvm::vfs::getRealFileSystem(),
- new DiagnosticOptions());
+ DiagOpts);
CreateInvocationOptions CIOpts;
CIOpts.Diags = Diags;
@@ -76,17 +77,17 @@ TEST(CompilerInstance, DefaultVFSOverlayFromInvocation) {
}
TEST(CompilerInstance, AllowDiagnosticLogWithUnownedDiagnosticConsumer) {
- auto DiagOpts = new DiagnosticOptions();
+ DiagnosticOptions DiagOpts;
// Tell the diagnostics engine to emit the diagnostic log to STDERR. This
// ensures that a chained diagnostic consumer is created so that the test can
// exercise the unowned diagnostic consumer in a chained consumer.
- DiagOpts->DiagnosticLogFile = "-";
+ DiagOpts.DiagnosticLogFile = "-";
// Create the diagnostic engine with unowned consumer.
std::string DiagnosticOutput;
llvm::raw_string_ostream DiagnosticsOS(DiagnosticOutput);
- auto DiagPrinter = std::make_unique<TextDiagnosticPrinter>(
- DiagnosticsOS, new DiagnosticOptions());
+ auto DiagPrinter =
+ std::make_unique<TextDiagnosticPrinter>(DiagnosticsOS, DiagOpts);
CompilerInstance Instance;
IntrusiveRefCntPtr<DiagnosticsEngine> Diags =
Instance.createDiagnostics(*llvm::vfs::getRealFileSystem(), DiagOpts,