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]

user defined conversion to void


//
// 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;
}


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