------- Comment #3 from pinskia at gcc dot gnu dot org 2007-03-04 20:56 ------- Reduced as far as I can get it: struct nsGetServiceByContractID { nsGetServiceByContractID (const char *aContractID) :mContractID (aContractID) { } const char *mContractID; }; struct nsCOMPtr_base { ~ nsCOMPtr_base (); }; struct nsCOMPtr { ~ nsCOMPtr (); void assign_from_gs_contractid (const nsGetServiceByContractID); nsCOMPtr () { } nsCOMPtr (const nsGetServiceByContractID gs) { assign_from_gs_contractid (gs); } int f(); }; const char kScriptSecurityManagerContractID[] = "f"; int CallOrConstruct ( int wrapper, char * argv ) { nsCOMPtr sop; int prinOrSop = 0; nsCOMPtr secman = nsGetServiceByContractID (kScriptSecurityManagerContractID); if (argv[0]) { nsCOMPtr_base xpc ; if (wrapper) prinOrSop = sop.f(); } if (!prinOrSop) return 0; return 222; }
-------------------------- If I change kScriptSecurityManagerContractID, not to be const, then the tetstcase works which means even more PR 31036 is very related as that one has the same issue with const decls too. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO| |31036 nThis| | Severity|normal |blocker Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2007-03-04 20:56:47 date| | Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31037