aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-04-28 10:00:42 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-04-28 10:00:42 +0000
commit152f6b7be508fbc61543f3736ebd390d7ac84bd1 (patch)
tree604bc10dce5d80f61b8b86aafc2eaf45ed30a5db /lib/AST/Type.cpp
parent470360d8035ce4213a963d281c3b542edfea9fda (diff)
Rename isPODType (using the C++98 rules) into isCXX98PODType and make isPODType decide which one to use based on LangOptions.
- -Wc++98-compat depends on the c++98 definition - Now __is_pod returns the right thing in c++11 and c++98 mode - All changes to the type traits test are validated against g++ 4.7 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp8
1 files changed, 8 insertions, 0 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.