[PATCH] D42530: Clang permits assignment to vector/extvector elements in a const method

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 11:15:10 PST 2018


rjmccall added a comment.

Thanks, that looks a lot better.  One minor piece of feedback, but otherwise LGTM.



================
Comment at: lib/Sema/SemaExpr.cpp:4402
+    Qualifiers MemberQuals =
+        Context.getCanonicalType(ResultType).getQualifiers();
+    Qualifiers Combined = BaseQuals + MemberQuals;
----------------
You shouldn't have to get the canonical type here.


================
Comment at: test/Sema/assign.c:17
+  b[4] = 1;         // expected-error {{cannot assign to variable 'b' with const-qualified type 'const arr' (aka 'int const[10]')}}
+  b2[4] = 1;        // expected-error {{cannot assign to variable 'b2' with const-qualified type 'const int [10]'}}
 }
----------------
These are nice improvements, thanks.  There's still room for getting ever better, but this is already nice progress.


https://reviews.llvm.org/D42530





More information about the llvm-commits mailing list