rjmccall added inline comments.

================
Comment at: clang/lib/Sema/SemaCast.cpp:2359
 
-  if (SrcType == DestType) {
+  if (SrcType == Self.Context.removeAddrSpaceQualType(DestType)) {
     // C++ 5.2.10p2 has a note that mentions that, subject to all other
----------------
I think the upshot of the conversation Richard and I just had is that there's a 
bug here for all qualifiers; that is, `reinterpret_cast<const int>(5)` should 
be allowed.  Probably the right thing to do is to strip qualifiers from 
DestType in the CastOperation constructor when the type is not a class or an 
array.  Richard, do you agree?  This isn't strictly implied by the C++ wording 
since the semantic analysis of the cast is logically prior to the introduction 
of a qualifier pr-value expression.


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

https://reviews.llvm.org/D102689

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

Reply via email to