From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 Description of problem: in c++locale.h around line 56, a template function is defined with default argument. This function is refined in locales_facets.tcc According to the C++ Standard, duplicate definition of default argument is not allowed. I believe this is a bug in the GNU GCC header files. There is also a bug in GCC, becuase according to the ISO C++ Standard sector 8.3.6 paragraph 4, it should not accept this code. The testcase defparm3.C fails to compile (which is correct) when no template is involved. g++ defparm3.C -c defparm3.C: In function `int foo(int)': defparm3.C:7: default argument given for parameter 1 of `int foo(int = -1)' defparm3.C:2: after previous specification in `int foo(int = -1)' The testcase defparm.C, even there is a redefined default arugment, GCC fails to catch it as an error. The c++locale.h header file should be changed such that the default argument is not redefined. Version-Release number of selected component (if applicable): gcc-3.2.3-2 How reproducible: Always Steps to Reproduce: 1.Compile the included defparm.C file to see GCC's incorrect accepting of default arugment. 2.Since GCC is incorrectly accepting the C++locale.h file, the bug in C++locale.h can only be seen when GCC is fixed. 3. Actual Results: GCC incorrectly accept code that's not ISO C++ compliance. Expected Results: GCC should give error on C++locale.h. C++locale.h should not redefine default arugment. Additional info:
Created attachment 92617 [details] shows GCC incorrectly accpet template with default arugment redefined.
Created attachment 92618 [details] Show GCC correct flag the error with redefined default arugment in non-template function.
*** Bug 98868 has been marked as a duplicate of this bug. ***
Mainline gcc and gcc-3_3-branch sources don't have the issue with c++locale.h. Perhaps previous versions did have the __convert_from_v default argument in two places: since this has been replaced in mainline and on gcc-3_3-branch it's no longer an issue. Anyway. I've tried to compile above with gcc-3_2-rhl-branch and gcc-3_3-branch and mainline gcc, and all give me the proper error, so I don't know what's up. Perhaps this is specific to ppc64 (seems unlikely?) -benjamin
I have changed gcc-3_2-rhl8-branch to avoid the problem there. As for the missing pedwarn, it is missing on all of gcc-3_2-rhl8-branch, gcc-3_3-branch and HEAD. Benjamin, you get any errors compiling: http://bugzilla.redhat.com/bugzilla/attachment.cgi?id=92617&action=view ?
------- Additional Comments From olof.com(prefers email via olof.com) 2003-05-08 18:26 ------- Do we have an estimate of when this will be fixed in RHEL? Thanks.
The bug in the headers is fixed in gcc-3.2.3-10 and later (ie. already in beta1 for example). Are you talking about the headers or the lack of diagnostics?
------- Additional Comments From olof.com(prefers email via olof.com) 2003-07-08 11:49 ------- I was talking about the headers. Closing this as FIXED_BY_DISTRO. Thanks Jakub! olof.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |FIXEDAWAITINGTEST Resolution| |FIX_BY_DISTRO
------- Additional Comments From kaena.com 2003-08-09 14:16 ------- Is this problem fixed? Or can someone answer Red Hat?
------- Additional Comments From kaena.com 2003-08-09 15:51 ------- Hi, This bug is fixed in beta1 or RHEL, but bugzilla won't let me add comment or update the status. Can you please close this defect for me? Thanks. -- Ka Lam C/C++ Compiler/Runtime Development IBM Toronto Laboratory kayinlam.com (905) 413-2733 C2/KD2/8200/MKM
closed, thanks.