This is an archive of the discontinued LLVM Phabricator instance.

Fix compile with GCC 6
ClosedPublic

Authored by dim on Apr 2 2016, 2:03 PM.

Details

Summary

Compiling with GCC 6 fails with "error: constructor required before non-static data member for ‘llvm::ValueEnumerator::MDRange::First’ has been parsed". The patch Replace MDRange's declaration of default constructor with a definition.

Diff Detail

Repository
rL LLVM

Event Timeline

rivanvx updated this revision to Diff 52477.Apr 2 2016, 2:03 PM
rivanvx retitled this revision from to Fix compile with GCC 6.
rivanvx updated this object.
rivanvx added a reviewer: dexonsmith.
rivanvx added a comment.EditedApr 2 2016, 2:09 PM

I'm using

$ g++ --version
g++ (GCC) 6.0.0 20160331 (Red Hat 6.0.0-0.19)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and

$ g++ --version
g++ (Debian 6-20160313-1) 6.0.0 20160313 (experimental) [trunk revision 234167]
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Both fail.

GCC 4.9 on Debian, 5 on Fedora 23 work fine. Can't really judge if this is a compiler bug or not, my knowledge of arcane C++11 wizardry is apprentice-level.

(Edit: correct information about GCC 6 on Debian.)

dexonsmith edited edge metadata.Apr 2 2016, 2:50 PM
dexonsmith added a subscriber: dexonsmith.

Thanks for tracking down a fix. LGTM.

Is GCC 6 being stricter than older versions? Is this behavior standard-compliant?

rivanvx abandoned this revision.Apr 27 2016, 1:17 PM

GCC 6.1 (GCC 6 final release in GCC's funky release numbering scheme) does not have this issue anymore: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70528

Thanks for the update!

dim commandeered this revision.Dec 10 2016, 12:33 PM
dim added a reviewer: rivanvx.
dim added a subscriber: dim.

Actually, the gcc maintainers reverted this change again, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70528 and https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=235171

So can we please apply this anyway? It is a minor change for such a fix.

dim reclaimed this revision.Dec 10 2016, 12:33 PM
dim added a reviewer: rsmith.
dim added a subscriber: llvm-commits.
dim added a comment.Dec 10 2016, 12:38 PM

Note, this problem also occurs with gcc release versions 5.4.0 and 6.2.0.

rivanvx accepted this revision.Dec 12 2016, 6:57 AM
rivanvx edited edge metadata.

Fine with me.

This revision is now accepted and ready to land.Dec 12 2016, 6:57 AM
This revision was automatically updated to reflect the committed changes.