This is an archive of the discontinued LLVM Phabricator instance.

adding __has_feature support for left c++ type_traits
AbandonedPublic

Authored by kamleshbhalui on Jan 12 2020, 4:28 AM.

Details

Summary

adding __has_feature support for left c++ type_traits.

fixes this
https://bugs.llvm.org/show_bug.cgi?id=44517

Diff Detail

Event Timeline

kamleshbhalui created this revision.Jan 12 2020, 4:28 AM

Probably needs test coverage (perhaps check the commits that added other feature tests - there's probably somewhere you can plugin tests in a similar way to plugging in the feature tests themselves)

rsmith requested changes to this revision.Jan 12 2020, 10:34 AM
rsmith added inline comments.
clang/include/clang/Basic/Features.def
191–192

Please see this comment. __has_builtin should be used to detect these type traits, per the documentation (https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives and https://clang.llvm.org/docs/LanguageExtensions.html#has-builtin), and already works for this purpose.

This revision now requires changes to proceed.Jan 12 2020, 10:34 AM
kamleshbhalui abandoned this revision.EditedJan 12 2020, 5:46 PM
not an issue since __has_builtin does the work.
i.e. __has_builtin(__is_same)