Bug 13437

Summary: [3.3 Regression] forward declaration in function scope hides inline
Product: gcc Reporter: Alexander Melkov <melkov>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, melkov
Priority: P2 Keywords: wrong-code
Version: 3.3.2   
Target Milestone: 3.4.0   
Host: i686-freebsd-gnu Target: i686-freebsd-gnu
Build: i686-freebsd-gnu Known to work: 3.2 3.4.0
Known to fail: Last reconfirmed: 2003-12-19 04:19:59

Description Alexander Melkov 2003-12-19 04:15:34 UTC
/usr/local/egcs-3/bin/c++ test.cpp
/var/tmp//ccdg0amh.o: In function `main':
/var/tmp//ccdg0amh.o(.text+0x11): undefined reference to `f()'

* 'inline' removed -> OK
* f declaration removed -> OK
(2.95.4 compiles that fine)

==> test.cpp <==
inline void f() {}
int main() {
  void f();
  f();
  return 0;
}
Comment 1 Andrew Pinski 2003-12-19 04:19:59 UTC
Confirmed on 3.3.3 but it is fixed on the mainline.  This is a regression from 2.95.3.
Comment 2 Andrew Pinski 2003-12-19 04:24:30 UTC
In fact it is a regression from 3.2.3 also.
Comment 3 Andrew Pinski 2003-12-19 04:25:10 UTC
And 3.3.1 (20030707).
Comment 4 Andrew Pinski 2003-12-19 04:29:02 UTC
In fact the change to mess this up went in between 20030801 and 20030802.
Comment 5 Andrew Pinski 2003-12-19 04:38:13 UTC
The patch which broke it on the mainline went in between 20030721 and 20030722.
The patch which fixed it on the mainline went in between 20030909 and 20030910.
Comment 6 Andrew Pinski 2003-12-19 04:53:53 UTC
The only patch that went in on the mainline and the branch at the time this broke was:

2003-08-01  Geoffrey Keating  <geoffk@apple.com>
        * c-pragma.c (maybe_apply_pragma_weak): Don't get DECL_ASSEMBLER_NAME
        when it's not needed.

And the only obvious patch which fixed this on the mainline is:
2003-09-09  Jan Hubicka  <jh@suse.cz>
        * varasm.c (notice_global_symbol):  Properly deal with weak symbols.

Both of these patches do not make real sense why they are causing or fixing the failures
Comment 7 Gabriel Dos Reis 2004-01-29 05:03:06 UTC
Postponed until 3.3.4
Comment 8 Gabriel Dos Reis 2004-04-18 18:15:04 UTC
Known to work for 3.4.0.  Won't fix for 3.3.4.