]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (is_cplusplus_method): Use Is_Primitive flag to detect primitive operations...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 8 Feb 2015 09:49:26 +0000 (09:49 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 8 Feb 2015 09:49:26 +0000 (09:49 +0000)
* gcc-interface/decl.c (is_cplusplus_method): Use Is_Primitive flag to
detect primitive operations of tagged and untagged types.

From-SVN: r220513

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index ba21f435ed0b05fbc898c54c6acf952dec96c2c4..ef516a38be70e940945fed645d0a09f60bd223e5 100644 (file)
@@ -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-01-05  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/64492
index 95bc778b4bde22822f0ee55174b9387eb2d0361f..0f62af7a4f315ce5e5eecc51a7989d8bc9eab8f4 100644 (file)
@@ -5510,16 +5510,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;