Hi all, The attached patch fixes a bug that causes valid OpenMP declare variant directive and functions to be rejected with the following error (see testcase): c_ptr.f90:41:37: 41 | !$omp declare variant(foo_variant) & | 1 Error: variant ‘foo_variant’ and base ‘foo’ at (1) have incompatible types: Type mismatch in argument 'c_bv' (INTEGER(8)/TYPE(c_ptr)) The fix consists in special-casing this situation in gfc_compare_types(). OK for mainline? Thanks, -- PA