]> granicus.if.org Git - clang/commit
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)
commit98f39b544ebabb0c964d5fd32650f99d4ae729f8
treea03e8d6b8bcd493297a03e2f5c9e6a7fb423ff8c
parent44abf78fbccbd1fc804540f52529aae868e0804b
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210855 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/TreeTransform.h
test/SemaTemplate/ms-sizeof-missing-typename.cpp [new file with mode: 0644]