Fix compile with GCC 5 or later
authorDimitry Andric <dimitry@andric.com>
Mon, 12 Dec 2016 19:05:52 +0000 (19:05 +0000)
committerDimitry Andric <dimitry@andric.com>
Mon, 12 Dec 2016 19:05:52 +0000 (19:05 +0000)
Summary:

Compiling with GCC 5 or later can fail with a bogus error "constructor
required before non-static data member for
llvm::ValueEnumerator::MDRange::First has been parsed".

This was originally fixed upstream in GCC PR 70528, but later this fix
was reverted, and released versions of GCC still show the bogus error.

To work around this, replace MDRange's declaration of a default
constructor with a definition.

Reviewers: dexonsmith, rsmith, rivanvx

Subscribers: llvm-commits, dim, dexonsmith

Differential Revision: https://reviews.llvm.org/D18730

llvm-svn: 289454

llvm/lib/Bitcode/Writer/ValueEnumerator.h

index bff2de7..a8d6cf9 100644 (file)
@@ -95,7 +95,7 @@ private:
     /// Number of strings in the prefix of the metadata range.
     unsigned NumStrings = 0;
 
-    MDRange() = default;
+    MDRange() {}
     explicit MDRange(unsigned First) : First(First) {}
   };
   SmallDenseMap<unsigned, MDRange, 1> FunctionMDInfo;