This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- From: "Raimund dot Merkert at baesystems dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2006 15:52:42 -0000
- Subject: [Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- References: <bug-25814-5307@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from Raimund dot Merkert at baesystems dot com 2006-11-14 15:52 -------
It does not seem to warn about unused functions. I also tried the following
test case where 4.0.0 (solaris) does not warn even about foo ( I guess because
it's referenced in Y's constructor?)
gcc -Wunused-function test.cpp
#include <cstdio>
static void foo() {}
struct Y {
Y() { foo(); }
};
struct X {
inline X (const Y&)
{}
inline ~X ()
{
::std::printf("1\n");
}
};
int main()
{
X x(Y());
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25814