diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e14b1c1c34d6cee0700fa36975fbfcb0d885092b..59c6c3886eb331d17946c10c00612b0fcd7fb3ca 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-02-08 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (is_cplusplus_method): Use Is_Primitive flag to + detect primitive operations of tagged and untagged types. + 2015-02-08 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/decl.c (gnat_to_gnu_entity): Do not bother about alias diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 12e5fd0b6bb97b099e26c717164c1bfee8b4b3a7..c7d64aab4497f2609f1cc4d9b4327f2f44dc8dc0 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -5448,16 +5448,17 @@ is_cplusplus_method (Entity_Id gnat_entity) if (Convention (gnat_entity) != Convention_CPP) return false; - /* This is the main case: C++ method imported as a primitive operation. */ - if (Is_Dispatching_Operation (gnat_entity)) + /* This is the main case: C++ method imported as a primitive operation. + Note that a C++ class with no virtual functions can be imported as a + limited record type so the operation is not necessarily dispatching. */ + if (Is_Primitive (gnat_entity)) return true; /* A thunk needs to be handled like its associated primitive operation. */ if (Is_Subprogram (gnat_entity) && Is_Thunk (gnat_entity)) return true; - /* C++ classes with no virtual functions can be imported as limited - record types, but we need to return true for the constructors. */ + /* A constructor is a method on the C++ side. */ if (Is_Constructor (gnat_entity)) return true;