diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Type.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 3f6a09457d..38b8e9f758 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -895,6 +895,14 @@ bool Type::isIncompleteType(NamedDecl **Def) const { } bool QualType::isPODType(ASTContext &Context) const { + // C++11 has a more relaxed definition of POD. + if (Context.getLangOpts().CPlusPlus0x) + return isCXX11PODType(Context); + + return isCXX98PODType(Context); +} + +bool QualType::isCXX98PODType(ASTContext &Context) const { // The compiler shouldn't query this for incomplete types, but the user might. // We return false for that case. Except for incomplete arrays of PODs, which // are PODs according to the standard. diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d2e0e6b63b..043a6f7fde 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -560,7 +560,8 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, // Complain about passing non-POD types through varargs. However, don't // perform this check for incomplete types, which we can get here when we're // in an unevaluated context. - if (!E->getType()->isIncompleteType() && !E->getType().isPODType(Context)) { + if (!E->getType()->isIncompleteType() && + !E->getType().isCXX98PODType(Context)) { // C++0x [expr.call]p7: // Passing a potentially-evaluated argument of class type (Clause 9) // having a non-trivial copy constructor, a non-trivial move constructor, |