[PATCH] D58060: Fix diagnostic for addr spaces in static_cast

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 12 14:03:22 PST 2019


rjmccall added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1830
+  "binding value %diff{of type $ to reference to type $|to reference}0,1 "
+  "changes address space">;
 def err_reference_bind_failed : Error<
----------------
We say that references are bound to objects, not that objects are bound to references.


================
Comment at: lib/Sema/SemaInit.cpp:4601
+      // addr space must be a superset.
+      T1Quals.isAddressSpaceSupersetOf(T2Quals))) {
     if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy)
----------------
I think the comment should go after the quote in the main comment above, i.e. something like "For address spaces, we interpret this to mean..."

Also, this clause is part of the parenthesized group and should be indented consistently.


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

https://reviews.llvm.org/D58060





More information about the cfe-commits mailing list