]> granicus.if.org Git - clang/commit
Improve source-location information in a C++ typeid (type) expression
authorDouglas Gregor <dgregor@apple.com>
Mon, 26 Apr 2010 22:37:10 +0000 (22:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 26 Apr 2010 22:37:10 +0000 (22:37 +0000)
commit57fdc8a4382164955c7b30d09f4ce46fc7e67659
tree1424bd02a4c985c9f5475e7301d4d3a147642332
parentfcaa9e787037b22a6833d4562fed3105c5b55f71
Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102393 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ExprCXX.h
lib/AST/ExprCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaExprCXX.cpp
lib/Sema/TreeTransform.h
test/SemaCXX/typeid-ref.cpp [new file with mode: 0644]
test/SemaCXX/typeid.cpp