This is an archive of the discontinued LLVM Phabricator instance.

Correct behavior of __builtin_*_overflow and constexpr.
ClosedPublic

Authored by erichkeane on Jun 11 2018, 2:16 PM.

Diff Detail

Event Timeline

erichkeane created this revision.Jun 11 2018, 2:16 PM
efriedma added a subscriber: efriedma.
efriedma added inline comments.
lib/Sema/SemaChecking.cpp
228

Is it possible for this initialization to fail? If it can't fail, please add an assertion; otherwise, you probably need to "return true". (Not sure off the top of my head how that would happen; maybe it would error out on a volatile int*?)

erichkeane marked an inline comment as done.

Add error checking to perform copy init.

lib/Sema/SemaChecking.cpp
228

You're correct, it apparently can fail! I've added a test to return true. Based on a reading of the code, performcopyinit diagnoses, so I think this patch should be correct.

This revision is now accepted and ready to land.Jun 12 2018, 2:05 PM
This revision was automatically updated to reflect the committed changes.