Topic: class A { A::A(); }; valid?


Author: Mike Stump <mrs@kithrup.com>
Date: 1995/10/10
Raw View
Is:

 class A { A::A(); };

valid?  I couldn't find the wording that would prohibit it.
Please cite the draft if you can.

---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]





Author: "Jirtme Desquilbet" <jDesquilbet@Rational.COM>
Date: 1995/10/13
Raw View
After checking the August 1995 C++ ISO Committee Draft, it appears that the
above code is *not* legal, although most compilers accept it.

"8.3 Meaning of declarators

[...] A declarator-id shall be a simple identifier, except for the following
cases: the declaration of some special functions, the definition of a member
function, the definition of a static data member, the declaration of a friend
function that is a member of another class."

So, a declarator-id for a class member *declaration* shall be a simple
identifier.

Well, as long as I my understanding of the CD is correct.

  Jerome.
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]





Author: "J\ir\tme Desquilbet" <jDesquilbet@Rational.COM>
Date: 1995/10/13
Raw View
After checking the August 1995 C++ ISO Committee Draft, it appears that the
above code is *not* legal, although most compilers accept it.

"8.3 Meaning of declarators

[...] A declarator-id shall be a simple identifier, except for the following
cases: the declaration of some special functions, the definition of a member
function, the definition of a static data member, the declaration of a friend
function that is a member of another class."

So, a declarator-id for a class member *declaration* shall be a simple
identifier.

Well, as long as I my understanding of the CD is correct.

  Jerome.




---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]