tbaeder added inline comments.

================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:446
+  if (Optional<PrimType> T = classify(LitType)) {
+    APInt Val(getIntWidth(LitType), E->getValue());
+    return this->emitConst(*T, 0, Val, E);
----------------
aaron.ballman wrote:
> Should this be concerned about the sign of the promoted literal?
Switched to `emitConst()` that takes into account signedness.


================
Comment at: clang/test/AST/Interp/arrays.cpp:135
+  static_assert(u32[1] == U'b', "");
+};
+
----------------
aaron.ballman wrote:
> I think you need a more coverage for character literals. Some test cases that 
> are interesting: multichar literals (`'abcd'`), character literals with UCNs 
> (`'\uFFFF'`), character literals with numeric escapes (`'\xFF'`). I'm 
> especially interested in seeing whether we handle integer promotions 
> properly, especially when promoting to `unsigned int`.
I added two more test cases but I'm generally not that familiar with character  
literal edge cases and integer promotion, so if you have concrete test cases in 
mind, that would be great :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135366/new/

https://reviews.llvm.org/D135366

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to