This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15625] [3.4/3.5 Regression] friend defined inside a template fails to find static function
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2004 13:57:16 -0000
- Subject: [Bug c++/15625] [3.4/3.5 Regression] friend defined inside a template fails to find static function
- References: <20040524013452.15625.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-05-24 13:57 -------
Here is something slightly smaller:
-------------------
template <typename T> struct S {
static void foo(const S&);
friend void bar(const S& s) { foo(s); }
};
int main() {
S<int> a; bar(a);
}
------------------
Although all prior versions of gcc before 3.4 and icc in strict mode
accept this code, I am a little puzzled why this is so: bar() is just
a friend, not a member, why should it look inside struct S to find the
static function? Why don't I have to qualify foo as S::foo?
Alas, that isn't the problem, from the error message gcc gives, it
is pretty obvious that gcc just gets somehow confused about templates
in this case.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15625