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 | ed36b2a80878c29603bdc89a7969253fb6446174 (patch) | |
tree | b8877259848db620a295e178dac8fc22b732104e /lib/Sema/SemaExprCXX.cpp | |
parent | 8e083e71d48f7f4d6ef40c00531c2e14df745486 (diff) |
Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 95dcbe9ad8..a053c2aed6 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/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)); } |