No Subject

Utilisateur FNET bravier@dassault-aviation.fr
Fri Feb 6 08:31:00 GMT 1998


===============================================================================
This is a bug report for egcs-1.0.1/g++:
===============================================================================

Thierry Bravier              Dassault Aviation - DGT / DPR / DESA
78, Quai Marcel Dassault       F-92214 Saint-Cloud Cedex - France
Telephone : (33) 01 47 11 53 07   Telecopie : (33) 01 47 11 52 83
E-Mail :              mailto:thierry.bravier@dassault-aviation.fr

===============================================================================
Local configuration:
===============================================================================
% uname -a
SunOS scdprs20 5.5.1 Generic sun4u sparc SUNW,Ultra-2

-------------------------------------------------------------------------------
% egcs-g++ -v
Reading specs from /logiciel/GNU/LOCAL/gcc/egcs-1.0.1/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)

-------------------------------------------------------------------------------
egcs-1.0.1 was installed with:

% SOURCES_EGCS=/logiciel/GNU/SOURCES/gcc/egcs-1.0.1/distrib
% LOCAL_EGCS=/logiciel/GNU/LOCAL/gcc/egcs-1.0.1
% OBJ_EGCS=/logiciel/commun/egcs-1.0.1.SunOS.5.5.1
% cd ${OBJ_EGCS}
% ${SOURCES_EGCS}/configure  \
   --prefix=${LOCAL_EGCS} \
   --with-local-prefix=${LOCAL_EGCS} \
   --with-gxx-include-dir=${LOCAL_EGCS}/include/g++
% gmake bootstrap CC=gcc
% gmake install

===============================================================================
Bug description and report:
===============================================================================
This seems to be a parsing problem relative to a default constructor call.

Apparently, when a default constructor is called while surrounded by
parentheses, g++ rejects the program.

Is it a bug ?

It does not seem coherent to accept line 2 and reject line 3.

PS: Thank you for your great work, I hope this mail will help.
    Could you please let me know about this mail and its implications.

-------------------------------------------------------------------------------
% cat -n default-constructor.cc
     1	class foo {};
     2	foo f_without_parentheses_is_ok = foo ();
     3	foo f_with_parentheses_causes_a_bug = (foo ());

-------------------------------------------------------------------------------
% egcs-g++ -E default-constructor.cc
# 1 "default-constructor.cc"
class foo {};
foo f_without_parentheses_is_ok = foo ();
foo f_with_parentheses_causes_a_bug = (foo ());

-------------------------------------------------------------------------------
% egcs-g++ -c default-constructor.cc 
default-constructor.cc:3: parse error before `;'

===============================================================================



More information about the Gcc-bugs mailing list