summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/DependencyFile.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-15 17:59:54 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-15 17:59:54 +0000
commitb472e93af7997da94b5e16bbeffab8cb1ee84c80 (patch)
treee6c44bf72220873f51eb457c81d34c70b84d4b22 /clang/lib/Frontend/DependencyFile.cpp
parentfad9d9572233aafac9f3ec63d6cc2e2a2a77f0e5 (diff)
downloadbcm5719-llvm-b472e93af7997da94b5e16bbeffab8cb1ee84c80.tar.gz
bcm5719-llvm-b472e93af7997da94b5e16bbeffab8cb1ee84c80.zip
Implement appropriate semantics for C++ casting and conversion when
dealing with address-space- and GC-qualified pointers. Previously, these qualifiers were being treated just like cvr-qualifiers (in some cases) or were completely ignored, leading to uneven behavior. For example, const_cast would allow conversion between pointers to different address spaces. The new semantics are fairly simple: reinterpret_cast can be used to explicitly cast between pointers to different address spaces (including adding/removing addresss spaces), while static_cast/dynamic_cast/const_cast do not tolerate any changes in the address space. C-style casts can add/remove/change address spaces through the reinterpret_cast mechanism. Other non-CVR qualifiers (e.g., Objective-C GC qualifiers) work similarly. As part of this change, I tweaked the "casts away constness" diagnostic to use the term "casts away qualifiers". The term "constness" actually comes from the C++ standard, despite the fact that removing "volatile" also falls under that category. In Clang, we also have restrict, address spaces, ObjC GC attributes, etc., so the more general "qualifiers" is clearer. llvm-svn: 129583
Diffstat (limited to 'clang/lib/Frontend/DependencyFile.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud