Recover from missing 'typename' in sizeof(T::InnerType)
authorReid Kleckner <reid@kleckner.net>
Thu, 12 Jun 2014 23:03:48 +0000 (23:03 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 12 Jun 2014 23:03:48 +0000 (23:03 +0000)
commit32506ed8be375ed3226adea8b507ad260dc3e31d
treedd1f31a11de299a3c4fec438f4030acbce5a612d
parent02ae6902fa42b6914815b1b6371de12cef3677fa
Recover from missing 'typename' in sizeof(T::InnerType)

Summary:
'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or
an expression.  This change threads a RecoveryTSI parameter through the
layers between TransformUnaryExprOrTypeTrait the point at which we look
up the type.  If lookup finds a single type result after instantiation,
we now build TypeSourceInfo for it just like a normal transformation
would.

This fixes the last error in the hello world ATL app that I've been
working with, and it now links and runs with clang.  Please try it and
file bugs!

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 210855
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/TreeTransform.h
clang/test/SemaTemplate/ms-sizeof-missing-typename.cpp [new file with mode: 0644]