diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 10:47:28 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 10:47:28 +0000 |
| commit | a3e1f9a02c6aeecb97009d5786713163f46cedce (patch) | |
| tree | 1e2e67c6ec8f271b75b5600a36817a2ac8987eee /clang/lib/Lex | |
| parent | 7980348fcf3a0f1da7352728493f00ff78852afb (diff) | |
| download | bcm5719-llvm-a3e1f9a02c6aeecb97009d5786713163f46cedce.tar.gz bcm5719-llvm-a3e1f9a02c6aeecb97009d5786713163f46cedce.zip | |
Implement basic __is_trivial type-trait support, enough to close PR9472.
This introduces a few APIs on the AST to bundle up the standard-based
logic so that programmatic clients have access to exactly the same
behavior.
There is only one serious FIXME here: checking for non-trivial move
constructors and move assignment operators. Those bits need to be added
to the declaration and accessors provided.
This implementation should be enough for the uses of __is_trivial in
libstdc++ 4.6's C++98 library implementation.
Ideas for more thorough test cases or any edge cases missing would be
appreciated. =D
llvm-svn: 130057
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 64b0baf3832..0e38e39c26a 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -590,6 +590,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("is_literal", LangOpts.CPlusPlus) .Case("is_pod", LangOpts.CPlusPlus) .Case("is_polymorphic", LangOpts.CPlusPlus) + .Case("is_trivial", LangOpts.CPlusPlus) .Case("is_union", LangOpts.CPlusPlus) .Case("tls", PP.getTargetInfo().isTLSSupported()) .Default(false); |

