diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-02-08 09:49:10 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-02-08 09:49:10 +0000 |
commit | 86ceee8522f4877bd76cd1848e7b39a9b1ce98ce (patch) | |
tree | fae4f50a44e1126d3d1d84888f5eb26ed02370f8 /gcc | |
parent | 9d11273c622b4b50d5bc5a4c9b382fd2b2dddaee (diff) | |
download | gcc-86ceee8522f4877bd76cd1848e7b39a9b1ce98ce.zip gcc-86ceee8522f4877bd76cd1848e7b39a9b1ce98ce.tar.gz gcc-86ceee8522f4877bd76cd1848e7b39a9b1ce98ce.tar.bz2 |
decl.c (is_cplusplus_method): Use Is_Primitive flag to detect primitive operations of tagged and untagged types.
* gcc-interface/decl.c (is_cplusplus_method): Use Is_Primitive flag to
detect primitive operations of tagged and untagged types.
From-SVN: r220512
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e14b1c1..59c6c38 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 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 sets in presence of derivation for subprogram types. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 12e5fd0..c7d64aa 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; |