]> granicus.if.org Git - clang/commitdiff
Workaround -Wdeprecated on SemDiagnosticConsumer's tricksy copy ctor.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 18 Aug 2015 20:54:26 +0000 (20:54 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 18 Aug 2015 20:54:26 +0000 (20:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245352 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/Sema.h

index 71357fe575585e97ed7c67c7ecbc07a70f18418d..a46a761706355f140fa22bb0dae53b0cc0cebf72 100644 (file)
@@ -1054,6 +1054,14 @@ public:
     SemaDiagnosticBuilder(DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
       : DiagnosticBuilder(DB), SemaRef(SemaRef), DiagID(DiagID) { }
 
+    // This is a cunning lie. DiagnosticBuilder actually performs move
+    // construction in its copy constructor (but due to varied uses, it's not
+    // possible to conveniently express this as actual move construction). So
+    // the default copy ctor here is fine, because the base class disables the
+    // source anyway, so the user-defined ~SemaDiagnosticBuilder is a safe no-op
+    // in that case anwyay.
+    SemaDiagnosticBuilder(const SemaDiagnosticBuilder&) = default;
+
     ~SemaDiagnosticBuilder() {
       // If we aren't active, there is nothing to do.
       if (!isActive()) return;