]> granicus.if.org Git - clang/commitdiff
Work around a GCC 4.7-specific issue: due to implementing older rules for
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 13 Sep 2016 18:35:34 +0000 (18:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 13 Sep 2016 18:35:34 +0000 (18:35 +0000)
implicit declarations of move operations, GCC 4.7 would find that SelectPiece
has neither a move constructor nor a copy constructor. The copy constructor was
(correctly) deleted because the class has a member of move-only type, and the
move constructor was (incorrectly, per current C++ rules) not provided because
the class has a copy-only base class (in turn because it explicitly declares a
destructor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281363 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/ClangDiagnosticsEmitter.cpp

index dafb93158abdf33f3f7ffdfa224c47db9e556d8e..d6881ae3074a8c04f8bdb58dbd407a6a2bc28dd7 100644 (file)
@@ -910,6 +910,11 @@ namespace {
 /// Diagnostic text, parsed into pieces.
 struct DiagText {
   struct Piece {
+    // This type and its derived classes are move-only.
+    Piece() = default;
+    Piece(Piece &&O) = default;
+    Piece &operator=(Piece &&O) = default;
+
     virtual void print(std::vector<std::string> &RST) = 0;
     virtual ~Piece() {}
   };