Fix compile with GCC 5 or later

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
This commit is contained in:
Dimitry Andric 2016-12-12 19:05:52 +00:00
parent 30422eea0f
commit 59e5cb4342
1 changed files with 1 additions and 1 deletions

View 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;