This revision was automatically updated to reflect the committed changes.
Closed by commit rGd6b0af0574ca: [clang][Interp] Add more shift error checking
(authored by tbaeder).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews
aaron.ballman accepted this revision.
aaron.ballman added a comment.
LGTM!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
tbaeder updated this revision to Diff 526965.
tbaeder marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
Files:
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/Interp.h
clang/test/AST/Interp/shifts.cpp
aaron.ballman added inline comments.
Comment at: clang/test/AST/Interp/shifts.cpp:165-171
+ constexpr int negativeShift() { // cxx17-error {{never produces a constant
expression}} \
+ // ref-cxx17-error {{never produces a
constant expression}}
tbaeder updated this revision to Diff 521237.
tbaeder marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
Files:
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/Interp.h
clang/test/AST/Interp/shifts.cpp
shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.
LGTM
Comment at: clang/lib/AST/Interp/Interp.h:141-142
+
+ // C++2a [expr.shift]p2: E1 << E2 is the unique value congruent to
+ // E1 x 2^E2 module 2^N.
+
tbaeder updated this revision to Diff 521082.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
Files:
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/Interp.h
clang/test/AST/Interp/shifts.cpp
Index: clang/test/AST/Interp/shifts.cpp
=
tbaeder updated this revision to Diff 521078.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
Files:
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/Interp.h
clang/test/AST/Interp/shifts.cpp
Index: clang/test/AST/Interp/shifts.cpp
=
tbaeder updated this revision to Diff 520954.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150209/new/
https://reviews.llvm.org/D150209
Files:
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/Interp.h
clang/test/AST/Interp/shifts.cpp
Index: clang/test/AST/Interp/shifts.cpp
=
tbaeder added inline comments.
Comment at: clang/lib/AST/Interp/Interp.h:136
+if (LHS.isNegative())
+ S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << 12;
+else if (LHS.toUnsigned().countLeadingZeros() < static_cast(RHS))
shafik wrote:
> Do w
shafik added inline comments.
Comment at: clang/lib/AST/Interp/Interp.h:133
+// operand, and must not overflow the corresponding unsigned type.
+// C++2a [expr.shift]p2: E1 << E2 is the unique value congruent to
+// E1 x 2^E2 module 2^N.
Maybe this qu
tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://revi
12 matches
Mail list logo