diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-07-01 01:24:09 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-07-01 01:24:09 +0000 |
commit | fe36cf9482c47d38d36d71965469f21813c22277 (patch) | |
tree | 57a6fb3fa7328b9dad05d3207748e3d64788e1fe /lib/Lex/PPMacroExpansion.cpp | |
parent | e1f24a2b85f06fedcacf7ee6ac31a25a25f697ce (diff) |
[Feature] Add a builtin for indexing into parameter packs. Patch by Louis Dionne.
This patch adds a __nth_element builtin that allows fetching the n-th type of a
parameter pack with very little compile-time overhead. The patch was inspired by
r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq
builtin for efficiently creating a std::integer_sequence.
Reviewed as D15421. http://reviews.llvm.org/D15421
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPMacroExpansion.cpp')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index a4734a2812..2ade6df945 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1695,6 +1695,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { const LangOptions &LangOpts = getLangOpts(); return llvm::StringSwitch<bool>(II->getName()) .Case("__make_integer_seq", LangOpts.CPlusPlus) + .Case("__type_pack_element", LangOpts.CPlusPlus) .Default(false); } }); |