r248760 - Add an explicitly defaulted copy ctor (and FIXME) to Command since its copy ctor is currently used (and actually slices derived objects... ) in some diagnostics handling.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 16:48:52 PDT 2015


Author: dblaikie
Date: Mon Sep 28 18:48:52 2015
New Revision: 248760

URL: http://llvm.org/viewvc/llvm-project?rev=248760&view=rev
Log:
Add an explicitly defaulted copy ctor (and FIXME) to Command since its copy ctor is currently used (and actually slices derived objects... ) in some diagnostics handling.

Justin mentioned he'd look into this.

Modified:
    cfe/trunk/include/clang/Driver/Job.h

Modified: cfe/trunk/include/clang/Driver/Job.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Job.h?rev=248760&r1=248759&r2=248760&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Job.h (original)
+++ cfe/trunk/include/clang/Driver/Job.h Mon Sep 28 18:48:52 2015
@@ -85,6 +85,9 @@ public:
   Command(const Action &Source, const Tool &Creator, const char *Executable,
           const llvm::opt::ArgStringList &Arguments,
           ArrayRef<InputInfo> Inputs);
+  // FIXME: This really shouldn't be copyable, but is currently copied in some
+  // error handling in Driver::generateCompilationDiagnostics.
+  Command(const Command &) = default;
   virtual ~Command() {}
 
   virtual void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote,




More information about the cfe-commits mailing list