diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-06-19 23:58:27 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-06-19 23:58:27 +0000 |
commit | 5f96883d446ff00665474b8882c23fbc98f47b12 (patch) | |
tree | 8dfd649c95d286b62239a8e98d6134571788d4cf /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 3bc72c1ec2b9828083cd0afad16fd655ca472916 (diff) | |
download | bcm5719-llvm-5f96883d446ff00665474b8882c23fbc98f47b12.tar.gz bcm5719-llvm-5f96883d446ff00665474b8882c23fbc98f47b12.zip |
Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.
llvm-svn: 158768
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 95dcbe9ad8d..a053c2aed60 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -374,6 +374,12 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc, LookupResult R(*this, TypeInfoII, SourceLocation(), LookupTagName); LookupQualifiedName(R, getStdNamespace()); CXXTypeInfoDecl = R.getAsSingle<RecordDecl>(); + // Microsoft's typeinfo doesn't have type_info in std but in the global + // namespace if _HAS_EXCEPTIONS is defined to 0. See PR13153. + if (!CXXTypeInfoDecl && LangOpts.MicrosoftMode) { + LookupQualifiedName(R, Context.getTranslationUnitDecl()); + CXXTypeInfoDecl = R.getAsSingle<RecordDecl>(); + } if (!CXXTypeInfoDecl) return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); } |