diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-02-06 10:59:19 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-02-06 10:59:19 +0000 |
commit | 595bf5c17f5f395d14c801b884d8569424cc34d0 (patch) | |
tree | 0f3e1760ee079f0f138c87955b721bf3ce68ac3b /lib/Sema/SemaTemplate.cpp | |
parent | a494d331c8edcca1e36eb31a95f8fa51a959021e (diff) |
MS ABI: Tweak pointer-to-member mangling/inheritance model selection
Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
pointer-to-member parameter, nail down an inheritance model.
N.B. We will chose an inheritance model even if we won't ultimately
choose the template to instantiate! Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
not zero. Previously, we chose an offset of 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index a6a3535d68..d24f7f01b8 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -20,6 +20,7 @@ #include "clang/AST/TypeVisitor.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/PartialDiagnostic.h" +#include "clang/Basic/TargetInfo.h" #include "clang/Sema/DeclSpec.h" #include "clang/Sema/Lookup.h" #include "clang/Sema/ParsedTemplate.h" @@ -4529,6 +4530,8 @@ static bool CheckTemplateArgumentPointerToMember(Sema &S, case NPV_NullPointer: S.Diag(Arg->getExprLoc(), diag::warn_cxx98_compat_template_arg_null); Converted = TemplateArgument(ParamType, /*isNullPtr*/true); + if (S.Context.getTargetInfo().getCXXABI().isMicrosoft()) + S.RequireCompleteType(Arg->getExprLoc(), ParamType, 0); return false; case NPV_NotNullPointer: break; |