[llvm] r289454 - Fix compile with GCC 5 or later

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 11:05:53 PST 2016

Author: dim
Date: Mon Dec 12 13:05:52 2016
New Revision: 289454

URL: http://llvm.org/viewvc/llvm-project?rev=289454&view=rev
Fix compile with GCC 5 or later


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


Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h?rev=289454&r1=289453&r2=289454&view=diff
--- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h (original)
+++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h Mon Dec 12 13:05:52 2016
@@ -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;

More information about the llvm-commits mailing list