[Bug c++/15625] [3.4/3.5 Regression] friend defined inside a template fails to find static function
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Tue May 25 09:17:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list