blob: 9f6783731d33ea2161cbcc2c53983825f983a31c [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -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}