This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GOLD][COMMITTED] Fix build breakage with -g.


On 1/13/10, Ian Lance Taylor <iant@google.com> wrote:
> "Doug Kwan (éæå)" <dougkwan@google.com> writes:
> > I did a bit more research and read the C++ standard again, especially
> > in [class.static.data].  Paragraph 4 of it says the following:
> >
> > "If a static data member is of const integral or const enumeration
> > type, its declaration in the class definition can specify a
> > constant-initializer which shall be ben integral constant expression
> > (5.19).  In that case, the member can appear in integral constant
> > expressions within its scope.  The member shall still be defined in a
> > namespace scope if it is used in the program and the namespace scope
> > definition shall not contain an initializer."
> >
> > Since the static const integral data members of
> > elfcpp::Elf_sizes<size> are used in many places outside of the class
> > scope, I think we should add definitions of them in the elfcpp
> > namespace.
>
> Yes, it's technically required but I've been avoiding it because I
> don't particularly want to add any .cc files in elfcpp.  It works fine
> with g++ as long as you avoid the case you just noticed of ?:.  I
> think it fails there because of an old g++ extension in which ?: is an
> lvalue.  In C++0x the definitions are not required.

In C++98 and C++0x an ?: expression can return an lvalue.  This behavior
has not changed.  Something more subtle must be going on to not require
the definition.

BTW, is it the intent that Gold only be compilable by g++?

-- 
Lawrence Crowl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]