This is an archive of the discontinued LLVM Phabricator instance.

[Alignment][NFC] Allow constexpr Align
ClosedPublic

Authored by gchatelet on Oct 2 2019, 4:27 AM.

Details

Summary

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Diff Detail

Repository
rL LLVM

Event Timeline

gchatelet created this revision.Oct 2 2019, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 4:27 AM
courbet accepted this revision.Oct 2 2019, 4:31 AM
This revision is now accepted and ready to land.Oct 2 2019, 4:31 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Oct 3 2019, 8:36 AM

This breaks building with gcc 5.3 (the system compiler on Ubuntu Xenial LTS), and supported by LLVM per https://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain

FAILED: lib/MC/CMakeFiles/LLVMMC.dir/MCAssembler.cpp.o 
/b/s/w/ir/cache/builder/src/third_party/llvm-build-tools/gcc530trusty/bin/g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/MC -I/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/MC -I/usr/include/libxml2 -Iinclude -I/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include -DLLVM_FORCE_HEAD_REVISION -fvisibility-inlines-hidden -Werror=date-time -std=c++14 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -MD -MT lib/MC/CMakeFiles/LLVMMC.dir/MCAssembler.cpp.o -MF lib/MC/CMakeFiles/LLVMMC.dir/MCAssembler.cpp.o.d -o lib/MC/CMakeFiles/LLVMMC.dir/MCAssembler.cpp.o -c /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/MC/MCAssembler.cpp
In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/MC/MCSection.h:20:0,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/MC/MCDwarf.h:22,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/MC/MCAssembler.h:20,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/MC/MCAssembler.cpp:9:
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/Support/Alignment.h:62:20: error: explicitly defaulted function ‘constexpr llvm::Align& llvm::Align::operator=(const llvm::Align&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
   constexpr Align &operator=(const Align &Other) = default;
                    ^
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/Support/Alignment.h:64:20: error: explicitly defaulted function ‘constexpr llvm::Align& llvm::Align::operator=(llvm::Align&&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
   constexpr Align &operator=(Align &&Other) = default;
                    ^

Can you take a look, and it's difficult to fix, revert for now?

This breaks building with gcc 5.3 (the system compiler on Ubuntu Xenial LTS), and supported by LLVM per https://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain

Thx for reporting, from stackoverflow it looks like a GCC bug.
I'm not sure it can be fixed so I'll revert the patch for now.

This breaks building with gcc 5.3 (the system compiler on Ubuntu Xenial LTS), and supported by LLVM per https://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain

Thx for reporting, from stackoverflow it looks like a GCC bug.
I'm not sure it can be fixed so I'll revert the patch for now.

reverted in rL373619