This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
user defined conversion to void
- To: gcc-bugs at gcc dot gnu dot org
- Subject: user defined conversion to void
- From: Stefan Schwarzer <sts at ica1 dot uni-stuttgart dot de>
- Date: Tue, 9 Nov 1999 23:28:30 +0100 (MET)
//
// the standard allows conversion functions (12.3.2) with the form
// operator type-specifier-seq ()
// now from the grammar summary one figures out that 'void' is a
// correct type-specifier-seq
// although it is not terribly useful (12.3.2.1) one
// is allowed to declare such
// functions (footnote 103)
// gcc-2.95.2 should thus compile this code
// Stefan Schwarzer sts@ica1.uni-stuttgart.de
struct A{
operator void(){};
};
int main(){
A a;
}