This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]