Page MenuHomePhabricator

NFC: static_assert instead of comment

Authored by jfb on Mar 25 2016, 3:00 PM.



isPodLike is as close as we have for is_trivially_copyable.

Diff Detail


Event Timeline

jfb updated this revision to Diff 51690.Mar 25 2016, 3:00 PM
jfb retitled this revision from to NFC: static_assert instead of comment.
jfb updated this object.
jfb added a subscriber: llvm-commits.
jfb added a comment.Mar 25 2016, 3:02 PM

This is just a drive-by of something I saw. Seems like the cleanest way to go about, I'm happy to fix in a different way if anyone thinks there's a better way.

Could/should we be using a standard trait (std::is_trivially_copyable)?

This revision was automatically updated to reflect the committed changes.
jfb added a comment.Mar 26 2016, 11:22 AM

For the record, the discussion on which llvm-commits didn't make it to phab:

Could/should we be using a standard trait (std::is_trivially_copyable)?

On Fri, Mar 25, 2016 at 3:33 PM, JF Bastien <> wrote:
It's not available in libstdc++ before GCC 5.1.

On Fri, Mar 25, 2016 at 3:37 PM, David Blaikie <> wrote:
Ah, fair enough then - carry on. (consider this code review approval if you like (I'm by no means a code owner in this particular corner, but would be comfortable enough committing similar changes myself))

No worries, I just figured I should open a PR in case anyone had a better idea than mine. The fix seemed strictly better than a comment, but hey it's Friday! I'll commit tomorrow if not :-)

jfb added a comment.Mar 26 2016, 11:23 AM

Ugh one of the Windows bots fails with this:

FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Zc:sizedDealloc- /MD /O2 /Ob2 -Ilib\CodeGen -IC:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\lib\CodeGen -Iinclude -IC:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\include    -UNDEBUG  /EHs-c- /GR- /showIncludes -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Folib\CodeGen\CMakeFiles\LLVMCodeGen.dir\MachineInstr.cpp.obj /Fdlib\CodeGen\CMakeFiles\LLVMCodeGen.dir\ /FS -c C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\lib\CodeGen\MachineInstr.cpp
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\lib\CodeGen\MachineInstr.cpp(762): error C2338: must be trivially copyable to memmove

I'll revert for now.

jfb added a comment.Mar 26 2016, 11:26 AM

Getting more bot failures, it's not just Windows.