This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [ELF] Fix compilation with GCC 5
ClosedPublic

Authored by mstorsjo on Nov 15 2018, 12:12 AM.

Details

Summary

Remove the default initializer for TrapInstr; all subclasses overwrite the defaults in their constructors anyway.

This fixes compilation errors like these, with GCC 5.4 on Ubuntu 16.04:

In file included from ../tools/lld/ELF/Arch/AArch64.cpp:12:0:
../tools/lld/ELF/Target.h:125:49: error: array must be initialized with a brace-enclosed initializer
   std::array<uint8_t, 4> TrapInstr = {0, 0, 0, 0};
                                                 ^
../tools/lld/ELF/Target.h:125:49: error: too many initializers for ‘std::array<unsigned char, 4ul>’

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Nov 15 2018, 12:12 AM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 15 2018, 12:22 AM
This revision was automatically updated to reflect the committed changes.