Skip to content

Commit 1bf945d

Browse files
committed
Define a default copy constructor.
Werror=deprecated-copy with GCC was triggered by code generated from this exp2cxx output. Go ahead and define the copy constructor to avoid the deprecated behavior.
1 parent 380618f commit 1bf945d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/exp2cxx/classes_type.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ void TYPEenum_inc_print( const Type type, FILE * inc ) {
182182

183183
/* constructors */
184184
strncpy( tdnm, TYPEtd_name( type ), BUFSIZ );
185-
tdnm[BUFSIZ-1] = '\0';
186-
fprintf( inc, " public:\n %s (const char * n =0, Enum"
187-
"TypeDescriptor *et =%s);\n", n, tdnm );
185+
tdnm[BUFSIZ - 1] = '\0';
186+
fprintf( inc, " public:\n %s (const char * n =0, EnumTypeDescriptor *et =%s);\n", n, tdnm );
188187
fprintf( inc, " %s (%s e, EnumTypeDescriptor *et =%s)\n"
189188
" : type(et) { set_value (e); }\n",
190189
n, EnumName( TYPEget_name( type ) ), tdnm );
190+
fprintf( inc, " %s (const %s &e) { set_value(e); }\n", n, TYPEget_ctype( type ) );
191191

192192
/* destructor */
193193
fprintf( inc, " ~%s () { }\n", n );

0 commit comments

Comments
 (0)