Current devel gcc complains about non-public copy ctors

RESOLVED WORKSFORME

Status

()

Core
String
--
minor
RESOLVED WORKSFORME
14 years ago
13 years ago

People

(Reporter: Kenneth Herron, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
I'm test-compiling mozilla with a copy of gcc built from their cvs HEAD (see
<http://gcc.gnu.org/cvs.html>), which will eventually become gcc 4.0. I've hit
compilation errors at several points where a (sub)string reference variable is
initialized from a function returning a substring object. In each case the gist
of the error is that the copy ctor for the variable is protected or private when
it must be public.

For example,
<http://lxr.mozilla.org/seamonkey/source/content/base/src/nsScriptLoader.cpp#303>
yields these errors:

../../../dist/include/string/nsTAString.h: In member function `PRBool
nsScriptLoader::IsScriptEventHandler(nsIScriptElement*)':
../../../dist/include/string/nsTAString.h:567: error:
`nsAString::nsAString(const nsAString&)' is private
/extra/kherron/moz/gcc4/../mozilla/content/base/src/nsScriptLoader.cpp:314:
error: within this context
../../../dist/include/string/nsTAString.h:567: error:
`nsAString::nsAString(const nsAString&)' is private
/extra/kherron/moz/gcc4/../mozilla/content/base/src/nsScriptLoader.cpp:314:
error: within this context

and
<http://lxr.mozilla.org/seamonkey/source/netwerk/base/src/nsStandardURL.cpp#515>
yields this error:

../../../dist/include/string/nsTSubstring.h: In member function `nsresult
nsStandardURL::BuildNormalizedSpec(const char*)':
../../../dist/include/string/nsTSubstring.h:434: error:
`nsCSubstring::nsCSubstring(const nsCSubstring&)' is protected
/extra/kherron/moz/gcc4/../mozilla/netwerk/base/src/nsStandardURL.cpp:516:
error: within this context
../../../dist/include/string/nsTSubstring.h:434: error:
`nsCSubstring::nsCSubstring(const nsCSubstring&)' is protected
/extra/kherron/moz/gcc4/../mozilla/netwerk/base/src/nsStandardURL.cpp:516:
error: within this context

I may be wrong, but according to <http://gcc.gnu.org/bugs.html#nonbugs_cxx>
"Copy constructor access check while initializing a reference", these seem to be
valid errors.
(Reporter)

Comment 1

14 years ago
Created attachment 159423 [details] [diff] [review]
Diff illustrating several examples

I was able to get past several compile errors where the Substring() function
was being called, as illustrated in this patch. The TrimWhitespace() example in
nsScriptLoader.cpp can't be fixed as easily, so at that point I stopped and
filed this bug report.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 2

13 years ago
This doesn't seem to be an issue any more. I built a fresh copy of gcc from
cvs--which now identifies itself as 4.1.0--and was able to build mozilla with no
trouble.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.