Tobias Burnus wrote:
Unfortunately, it turns out that the check does not handle inheritance well. At least I would expect that the attached test case is valid (and it compiles with NAG 5.1), but it is rejected with GCC 4.6 and 4.7.

Actually, I withdraw that comment. I now believe that gt_cmp and gt_cmp_int are ambiguous in

+ generic :: operator(.gt.) => gt_cmp
+ generic :: operator(.gt.) => gt_cmp_int

as an actual argument of declared type class(sort_t) is type compatible to a dummy of declared type class(sort_int_t).

The fix is to do the following. One keeps for the first type:

+    generic :: operator(.gt.) =>  gt_cmp
+    procedure :: gt_cmp
+    end type sort_t


And then later just has:

+    procedure :: gt_cmp =>  gt_cmp_int
+  end type


That is: One overrides the specific function, one does not add a new generic interface.

Tobias

Reply via email to