From 5088cdf4d1216ce39d1f975811cdd989f295a719 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 5 Nov 2015 01:01:47 +0000 Subject: [Lex] Add __has_builtin support for __make_integer_seq Differential Revision: http://reviews.llvm.org/D14349 llvm-svn: 252115 --- clang/lib/Lex/PPMacroExpansion.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'clang/lib/Lex') diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index d8d6b0b90dd..40b5496ad7c 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1636,7 +1636,15 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { Value = FeatureII->getTokenID() == tok::identifier; else if (II == Ident__has_builtin) { // Check for a builtin is trivial. - Value = FeatureII->getBuiltinID() != 0; + if (FeatureII->getBuiltinID() != 0) { + Value = true; + } else { + const LangOptions &LangOpts = PP.getLangOpts(); + StringRef Feature = FeatureII->getName(); + Value = llvm::StringSwitch(Feature) + .Case("__make_integer_seq", LangOpts.CPlusPlus) + .Default(false); + } } else if (II == Ident__has_attribute) Value = hasAttribute(AttrSyntax::GNU, nullptr, FeatureII, getTargetInfo(), getLangOpts()); -- cgit v1.2.3