]> granicus.if.org Git - clang/commitdiff
Implement a __has_feature for __underlying_type
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 May 2011 20:48:13 +0000 (20:48 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 19 May 2011 20:48:13 +0000 (20:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_feature_type_traits.cpp

index 6a9d4abef1b0bd3ef29bd0e988027ea088c3d0c7..5315279f9a0bc75ee7b0422bec56c1612462f254 100644 (file)
@@ -602,6 +602,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("is_trivial", LangOpts.CPlusPlus)
            .Case("is_trivially_copyable", LangOpts.CPlusPlus)
            .Case("is_union", LangOpts.CPlusPlus)
+           .Case("underlying_type", LangOpts.CPlusPlus)
            .Case("tls", PP.getTargetInfo().isTLSSupported())
            .Default(false);
 }
index 5da845f06512085bb3c90a9182733d406ba39d2c..f46165de3f225409a1101f376f2d65f946b03849 100644 (file)
@@ -99,3 +99,7 @@ int is_standard_layout();
 int is_trivially_copyable();
 #endif
 // CHECK: int is_trivially_copyable();
+
+#if __has_feature(underlying_type)
+int underlying_type();
+#endif