2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2008-10-24 22:09:54 +04:00
|
|
|
|
|
|
|
// PR2942
|
|
|
|
typedef void fn(int);
|
2008-11-24 02:12:31 +03:00
|
|
|
fn f; // expected-note {{previous declaration is here}}
|
2008-10-27 15:50:38 +03:00
|
|
|
|
|
|
|
int g(int x, int y);
|
|
|
|
int g(int x, int y = 2);
|
|
|
|
|
|
|
|
typedef int g_type(int, int);
|
|
|
|
g_type g;
|
|
|
|
|
2008-11-24 02:12:31 +03:00
|
|
|
int h(int x) { // expected-note {{previous definition is here}}
|
2008-10-27 15:50:38 +03:00
|
|
|
return g(x);
|
|
|
|
}
|
2008-10-29 18:10:40 +03:00
|
|
|
|
|
|
|
float f(int) { } // expected-error{{functions that differ only in their return type cannot be overloaded}}
|
|
|
|
|
|
|
|
int h(int) { } // expected-error{{redefinition of 'h'}}
|
|
|
|
|