]> granicus.if.org Git - clang/commit
Improve the error message for assigning to read-only variables.
authorRichard Trieu <rtrieu@google.com>
Sat, 11 Apr 2015 01:53:13 +0000 (01:53 +0000)
committerRichard Trieu <rtrieu@google.com>
Sat, 11 Apr 2015 01:53:13 +0000 (01:53 +0000)
commit7d191b2364ab007773cdb792dbd64d1f92158618
tree72876ffa3abbccb82ccd04593ccc412bac4e1006
parent9ce9d444a389e0e0179dda133269d6ca4f28a35f
Improve the error message for assigning to read-only variables.

Previously, many error messages would simply be "read-only variable is not
assignable"  This change provides more information about why the variable is
not assignable, as well as note to where the const is located.

Differential Revision: http://reviews.llvm.org/D4479

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234677 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/CXX/temp/temp.decls/temp.mem/p5.cpp
test/Sema/anonymous-struct-union.c
test/Sema/assign.c
test/Sema/block-misc.c
test/SemaCXX/anonymous-union.cpp
test/SemaCXX/captured-statements.cpp
test/SemaCXX/cxx0x-constexpr-const.cpp
test/SemaCXX/err_typecheck_assign_const.cpp [new file with mode: 0644]
test/SemaCXX/err_typecheck_assign_const_filecheck.cpp [new file with mode: 0644]
test/SemaCXX/function-type-qual.cpp
test/SemaObjC/arc.m
test/SemaTemplate/dependent-type-identity.cpp