From: Sean Hunt Date: Thu, 19 May 2011 20:48:13 +0000 (+0000) Subject: Implement a __has_feature for __underlying_type X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0191b6b638ee57cc1108f427fc93d57e75ef7222;p=clang Implement a __has_feature for __underlying_type git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131672 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 6a9d4abef1..5315279f9a 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -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); } diff --git a/test/Lexer/has_feature_type_traits.cpp b/test/Lexer/has_feature_type_traits.cpp index 5da845f065..f46165de3f 100644 --- a/test/Lexer/has_feature_type_traits.cpp +++ b/test/Lexer/has_feature_type_traits.cpp @@ -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