]> granicus.if.org Git - clang/commit
Fix the equal-vector-size rule for reinterpret_casts in C++
authorJohn McCall <rjmccall@apple.com>
Thu, 23 Jul 2015 23:54:07 +0000 (23:54 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 23 Jul 2015 23:54:07 +0000 (23:54 +0000)
commit3c880489dac6efe5912cc0b6ce9792a30e6a7c09
tree0139c03498df6ed70436eae5f14184b962bee8e2
parent2b65eeba66e150271f752056b57c1f73526cc2db
Fix the equal-vector-size rule for reinterpret_casts in C++
to consider the storage size of the vector instead of its
sizeof.  In other words, ban <3 x int> to <4 x int> casts,
which produced invalid IR anyway.

Also, attempt to be a little more rigorous, or at least
explicit, about when enums are allowed in these casts.

rdar://21901132

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243069 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaCast.cpp
lib/Sema/SemaExpr.cpp
test/Sema/vector-cast.c
test/SemaCXX/vector-casts.cpp