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]

Possible bug, or at least a severe inconvience.


Hello, I have some code which I wish to have inlined automatically, thus I
am defining it within the class declaration. To make it look pretty, I
wish to have all of the function declarations listed first, and then do
the actual defintions later within the class. Anyways,

If this is non-standard, I think that it still would be a useful
extension. It certainly was keeping my files easier to read.. Other than
this, you have a great compiler, keep up the good work!


class foo {
public:
  int bar();
  int bar() { return 10;};
};

[crosby@hypercube indep_study]# g++ -c -o /tmp/foo /tmp/foo.cpp 
/tmp/foo.cpp:4: `foo::bar()' is already defined in class foo
[crosby@hypercube indep_study]# g++ --version
egcs-2.91.57









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