diff options
author | Marc-Andre Laperle | 2020-09-26 05:32:42 +0000 |
---|---|---|
committer | Marc-André Laperle | 2020-10-03 16:42:48 +0000 |
commit | a6baac71724581bea7bf0c1f6e88e29216bb38f1 (patch) | |
tree | e6510715c80a86e7ed8ba67cde4d22494b9f6201 /core | |
parent | 90a837665813a3993bd2c3e050ca12d7d99a7515 (diff) | |
download | org.eclipse.cdt-a6baac71724581bea7bf0c1f6e88e29216bb38f1.tar.gz org.eclipse.cdt-a6baac71724581bea7bf0c1f6e88e29216bb38f1.tar.xz org.eclipse.cdt-a6baac71724581bea7bf0c1f6e88e29216bb38f1.zip |
Bug 567377 - Add built-ins for Clang already present in parser for other compilers
These were already there for GCC but not for Clang and they are
supported by Clang:
__is_literal (synonym for __is_literal_type)
__is_standard_layout
__is_trivial
__is_trivially_copyable
__float128
__int128
Change-Id: Iec6151492cd30f17e2a5aa4617f6e88812f0f4cc
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'core')
2 files changed, 60 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/GPPScannerExtensionConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/GPPScannerExtensionConfiguration.java index b113e67ba71..aa659a7e711 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/GPPScannerExtensionConfiguration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/parser/cpp/GPPScannerExtensionConfiguration.java @@ -181,28 +181,76 @@ public class GPPScannerExtensionConfiguration extends GNUScannerExtensionConfigu // As documented at // http://clang.llvm.org/docs/LanguageExtensions.html#checks-for-type-trait-primitives. // For now we don't make it dependent on the version. + // Missing ones are in comments addKeyword(GCCKeywords.cp__has_nothrow_assign, IGCCToken.tTT_has_nothrow_assign); - addKeyword(GCCKeywords.cp__has_nothrow_constructor, IGCCToken.tTT_has_nothrow_constructor); + // __has_nothrow_move_assign addKeyword(GCCKeywords.cp__has_nothrow_copy, IGCCToken.tTT_has_nothrow_copy); + addKeyword(GCCKeywords.cp__has_nothrow_constructor, IGCCToken.tTT_has_nothrow_constructor); addKeyword(GCCKeywords.cp__has_trivial_assign, IGCCToken.tTT_has_trivial_assign); - addKeyword(GCCKeywords.cp__has_trivial_constructor, IGCCToken.tTT_has_trivial_constructor); + // __has_trivial_move_assign addKeyword(GCCKeywords.cp__has_trivial_copy, IGCCToken.tTT_has_trivial_copy); + addKeyword(GCCKeywords.cp__has_trivial_constructor, IGCCToken.tTT_has_trivial_constructor); addKeyword(GCCKeywords.cp__has_trivial_destructor, IGCCToken.tTT_has_trivial_destructor); + // __has_unique_object_representations addKeyword(GCCKeywords.cp__has_virtual_destructor, IGCCToken.tTT_has_virtual_destructor); addKeyword(GCCKeywords.cp__is_abstract, IGCCToken.tTT_is_abstract); + // __is_aggregate + // __is_arithmetic + // __is_array + // __is_assignable addKeyword(GCCKeywords.cp__is_base_of, IGCCToken.tTT_is_base_of); addKeyword(GCCKeywords.cp__is_class, IGCCToken.tTT_is_class); + // __is_complete_type + // __is_compound + // __is_const + addKeyword(GCCKeywords.cp__is_constructible, IGCCToken.tTT_is_constructible); + // __is_convertible + // __is_convertible_to + // __is_destructible addKeyword(GCCKeywords.cp__is_empty, IGCCToken.tTT_is_empty); addKeyword(GCCKeywords.cp__is_enum, IGCCToken.tTT_is_enum); + addKeyword(GCCKeywords.cp__is_final, IGCCToken.tTT_is_final); + // __is_floating_point + // __is_function + // __is_fundamental + // __is_integral + // __is_interface_class + addKeyword(GCCKeywords.cp__is_literal, IGCCToken.tTT_is_literal_type); + addKeyword(GCCKeywords.cp__is_literal_type, IGCCToken.tTT_is_literal_type); + // __is_lvalue_reference + // __is_member_object_pointer + // __is_member_function_pointer + // __is_member_pointer + // __is_nothrow_assignable + // __is_nothrow_constructible + // __is_nothrow_destructible + // __is_object addKeyword(GCCKeywords.cp__is_pod, IGCCToken.tTT_is_pod); + // __is_pointer addKeyword(GCCKeywords.cp__is_polymorphic, IGCCToken.tTT_is_polymorphic); + // __is_reference + // __is_rvalue_reference + // __is_same + // __is_same_as + // __is_scalar + // __is_sealed + // __is_signed + addKeyword(GCCKeywords.cp__is_standard_layout, IGCCToken.tTT_is_standard_layout); + addKeyword(GCCKeywords.cp__is_trivial, IGCCToken.tTT_is_trivial); + addKeyword(GCCKeywords.cp__is_trivially_assignable, IGCCToken.tTT_is_trivially_assignable); + addKeyword(GCCKeywords.cp__is_trivially_constructible, IGCCToken.tTT_is_trivially_constructible); + addKeyword(GCCKeywords.cp__is_trivially_copyable, IGCCToken.tTT_is_trivially_copyable); + // __is_trivially_destructible addKeyword(GCCKeywords.cp__is_union, IGCCToken.tTT_is_union); - addKeyword(GCCKeywords.cp__is_final, IGCCToken.tTT_is_final); + // __is_unsigned + // __is_void + // __reference_binds_to_temporary addKeyword(GCCKeywords.cp__underlying_type, IGCCToken.tTT_underlying_type); - addKeyword(GCCKeywords.cp__is_trivially_constructible, IGCCToken.tTT_is_trivially_constructible); - addKeyword(GCCKeywords.cp__is_trivially_assignable, IGCCToken.tTT_is_trivially_assignable); - addKeyword(GCCKeywords.cp__is_constructible, IGCCToken.tTT_is_constructible); addKeyword(GCCKeywords.cp__integer_pack, IGCCToken.tTT_integer_pack); + + addKeyword(GCCKeywords.cp__float128, IGCCToken.t__float128); + addKeyword(GCCKeywords.cp__int128, IGCCToken.t__int128); + //TODO verify other gcc ones } else if (compiler == CompilerType.MSVC) { // As documented at // https://docs.microsoft.com/en-us/cpp/extensions/compiler-support-for-type-traits-cpp-component-extensions?view=vs-2017 diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/GCCKeywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/GCCKeywords.java index 207ef6d89d9..2062b2ec639 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/GCCKeywords.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/GCCKeywords.java @@ -93,4 +93,10 @@ public class GCCKeywords { /** @since 6.11*/ public static final char[] cp__integer_pack = "__integer_pack".toCharArray(); + + /** + * This is actually for Clang but we don't maintain separate keywords right now. + * @since 7.1 + */ + public static final char[] cp__is_literal = "__is_literal".toCharArray(); } |