rsmith added inline comments.
================ Comment at: clang/lib/AST/ExprConstant.cpp:5447 + + case APValue::LValue: { + LValue LVal; ---------------- jfb wrote: > rsmith wrote: > > This will permit bitcasts from `nullptr_t`, providing a zero value. I think > > that's wrong; the bit representation of `nullptr_t` is notionally > > uninitialized (despite strangely having pointer size and alignment). > > > > I think this is a specification bug: `bit_cast<intptr_t>(nullptr)` should > > be non-constant (it won't necessarily be `0` at runtime) but the current > > wording doesn't seem to permit us to treat it as non-constant. > You brought this up in ABQ, the outcome was... poor notes so I have no idea > what Core decided... It looks like we never actually resolved what happens in this case ;-( ================ Comment at: clang/lib/AST/ExprConstant.cpp:5549 + // Ideally this will be unreachable. + llvm::NoneType unsupportedType(QualType Ty) { + Info.FFDiag(BCE->getBeginLoc(), ---------------- Support for bitcasting to `nullptr_t` seems to be missing. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62825/new/ https://reviews.llvm.org/D62825 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits