blob: b15d866165850b3b4117ec360530356de35aee55 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregor04495c82009-02-24 01:23:02 +00002int foo(int);
3
4namespace N {
5 void f1() {
6 void foo(int); // okay
7 }
8
9 // FIXME: we shouldn't even need this declaration to detect errors
10 // below.
11 void foo(int); // expected-note{{previous declaration is here}}
12
13 void f2() {
14 int foo(int); // expected-error{{functions that differ only in their return type cannot be overloaded}}
15
16 {
17 int foo;
18 {
19 // FIXME: should diagnose this because it's incompatible with
20 // N::foo. However, name lookup isn't properly "skipping" the
21 // "int foo" above.
22 float foo(int);
23 }
24 }
25 }
26}