[PATCH] D48053: Correct behavior of __builtin_*_overflow and constexpr.
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 12 05:49:57 PDT 2018
erichkeane added inline comments.
================
Comment at: lib/Sema/SemaChecking.cpp:228
+ S.getASTContext(), Ty, /*consume*/ false);
+ Arg = S.PerformCopyInitialization(Entity, SourceLocation(), Arg);
+ TheCall->setArg(2, Arg.get());
----------------
efriedma wrote:
> 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*`?)
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.
https://reviews.llvm.org/D48053
More information about the cfe-commits
mailing list