M
mathieu
Hi there,
Could someone let me know why Comeau reports an error on the
following code. The compiler should provide a default constuctor for
me.
struct A { int I; };
int main()
{
const A a;
return 0;
}
Thanks !
Output:
Comeau C/C++ 4.3.9 (Mar 27 2007 17:24:47) for ONLINE_EVALUATION_BETA2
Copyright 1988-2007 Comeau Computing. All rights reserved.
MODE:strict errors C++ noC++0x_extensions
"ComeauTest.c", line 8: error: const variable "a" requires an
initializer -- class
"A" has no explicitly declared default constructor
const A a;
^
"ComeauTest.c", line 8: warning: variable "a" was declared but never
referenced
const A a;
^
1 error detected in the compilation of "ComeauTest.c".
Could someone let me know why Comeau reports an error on the
following code. The compiler should provide a default constuctor for
me.
struct A { int I; };
int main()
{
const A a;
return 0;
}
Thanks !
Output:
Comeau C/C++ 4.3.9 (Mar 27 2007 17:24:47) for ONLINE_EVALUATION_BETA2
Copyright 1988-2007 Comeau Computing. All rights reserved.
MODE:strict errors C++ noC++0x_extensions
"ComeauTest.c", line 8: error: const variable "a" requires an
initializer -- class
"A" has no explicitly declared default constructor
const A a;
^
"ComeauTest.c", line 8: warning: variable "a" was declared but never
referenced
const A a;
^
1 error detected in the compilation of "ComeauTest.c".