Bug 13437 - [3.3 Regression] forward declaration in function scope hides inline
Summary: [3.3 Regression] forward declaration in function scope hides inline
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
Keywords: wrong-code
Depends on:
Reported: 2003-12-19 04:15 UTC by Alexander Melkov
Modified: 2004-04-18 18:15 UTC (History)
2 users (show)

See Also:
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


Note You need to log in before you can comment on or make changes to this bug.
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();
  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.