// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // poly-selection.cfa -- tests that show correct candidates selected, given interesting cases of // forall/overload polymoprphism // // Author : Michael Brooks // Created On : Mon Jan 18 15:00:00 2021 // Last Modified By : Michael Brooks // Last Modified On : Mon Jan 18 15:00:00 2021 // Update Count : 1 // void testSpecializationFromGenericOverBareTyvar() { forall( dtype T ) void friend( T & ) { printf("friending generically\n"); } forall(dtype T) struct thing { int x; }; forall( dtype T ) void friend( thing(T) & ) { printf("friending specifically\n"); } float x; friend( x ); thing(float) y; friend( y ); } int main() { testSpecializationFromGenericOverBareTyvar(); }