1*8fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s 2a8aa7a08SDouglas Gregor 3a8aa7a08SDouglas Gregor // PR2942 4a8aa7a08SDouglas Gregor typedef void fn(int); 50369c57aSChris Lattner fn f; // expected-note {{previous declaration is here}} 689ebcb9dSDouglas Gregor 789ebcb9dSDouglas Gregor int g(int x, int y); 889ebcb9dSDouglas Gregor int g(int x, int y = 2); 989ebcb9dSDouglas Gregor 1089ebcb9dSDouglas Gregor typedef int g_type(int, int); 1189ebcb9dSDouglas Gregor g_type g; 1289ebcb9dSDouglas Gregor h(int x)130369c57aSChris Lattnerint h(int x) { // expected-note {{previous definition is here}} 1489ebcb9dSDouglas Gregor return g(x); 1589ebcb9dSDouglas Gregor } 16cad304baSDouglas Gregor f(int)17cad304baSDouglas Gregorfloat f(int) { } // expected-error{{functions that differ only in their return type cannot be overloaded}} 18cad304baSDouglas Gregor h(int)19cad304baSDouglas Gregorint h(int) { } // expected-error{{redefinition of 'h'}} 20cad304baSDouglas Gregor 21