Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | 04495c8 | 2009-02-24 01:23:02 +0000 | [diff] [blame] | 2 | int foo(int); |
| 3 | |
| 4 | namespace 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 | } |