]> granicus.if.org Git - clang/commit
[analyzer] Treat LValueBitCasts like regular pointer bit casts.
authorJordan Rose <jordan_rose@apple.com>
Mon, 11 Jun 2012 23:20:52 +0000 (23:20 +0000)
committerJordan Rose <jordan_rose@apple.com>
Mon, 11 Jun 2012 23:20:52 +0000 (23:20 +0000)
commit570d03c6831a8e19447dc863aa94ffff020077eb
treeb513219a733e1b553a92ad5cbc8928b3864d3966
parentdd895f056bff47d2d1a924b49e7b40d48749fcc0
[analyzer] Treat LValueBitCasts like regular pointer bit casts.

These casts only appear in very well-defined circumstances, in which the
target of a reinterpret_cast or a function formal parameter is an lvalue
reference. According to the C++ standard, the following are equivalent:

 reinterpret_cast<T&>( x)
*reinterpret_cast<T*>(&x)

[expr.reinterpret.cast]p11

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158338 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineC.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp
test/Analysis/casts.cpp [new file with mode: 0644]