This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28058] [4.1/4.2 regression] ICE in inline_forbidden_p
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2006 16:53:46 -0000
- Subject: [Bug c++/28058] [4.1/4.2 regression] ICE in inline_forbidden_p
- References: <bug-28058-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from mmitchel at gcc dot gnu dot org 2006-08-26 16:53 -------
We do have code to notice use-before-specialization errors. For example:
template <typename T> void f();
void g() {
f<int>();
}
template <> void f<int>() {}
results in an error.
However, the code to initialize static variables is not generated until
end-of-file, so we do not realize that we are in this situation. (See
expand_static_init for the point at which we defer initialization.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28058