diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-06-12 23:03:48 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-06-12 23:03:48 +0000 |
commit | 98f39b544ebabb0c964d5fd32650f99d4ae729f8 (patch) | |
tree | a03e8d6b8bcd493297a03e2f5c9e6a7fb423ff8c /include | |
parent | 44abf78fbccbd1fc804540f52529aae868e0804b (diff) | |
download | clang-98f39b544ebabb0c964d5fd32650f99d4ae729f8.tar.gz clang-98f39b544ebabb0c964d5fd32650f99d4ae729f8.tar.bz2 clang-98f39b544ebabb0c964d5fd32650f99d4ae729f8.tar.xz |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 2 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 95b204f548..1751860f45 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3550,7 +3550,7 @@ def note_typename_refers_here : Note< "referenced member %0 is declared here">; def err_typename_missing : Error< "missing 'typename' prior to dependent type name '%0%1'">; -def warn_typename_missing : ExtWarn< +def ext_typename_missing : ExtWarn< "missing 'typename' prior to dependent type name '%0%1'">, InGroup<DiagGroup<"typename-missing">>; def ext_typename_outside_of_template : ExtWarn< diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index ac0897e0d9..414a67e256 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -3403,9 +3403,10 @@ public: const LookupResult &R, bool HasTrailingLParen); - ExprResult BuildQualifiedDeclarationNameExpr(CXXScopeSpec &SS, - const DeclarationNameInfo &NameInfo, - bool IsAddressOfOperand); + ExprResult BuildQualifiedDeclarationNameExpr( + CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, + bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI = nullptr); + ExprResult BuildDependentDeclRefExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, |