OSDN Git Service

[flang][driver] Fix a small bug (auto vs auto&)
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Mon, 14 Dec 2020 16:07:24 +0000 (16:07 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Mon, 14 Dec 2020 16:10:07 +0000 (16:10 +0000)
This bug hasn't affected us yet as our usage is too basic, i.e. we don't
rely on the defaults provided by `SetDefaultFortranOpts` just yet. This
will change shortly.

flang/lib/Frontend/CompilerInvocation.cpp

index 85c2234..8a6f661 100644 (file)
@@ -185,7 +185,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &res,
 }
 
 void CompilerInvocation::SetDefaultFortranOpts() {
-  auto fortranOptions = fortranOpts();
+  auto &fortranOptions = fortranOpts();
 
   // These defaults are based on the defaults in f18/f18.cpp.
   std::vector<std::string> searchDirectories{"."s};