[llvm-commits] [lld] [PATCH] "friend class" fixes

Richard Smith richard at metafoo.co.uk
Wed Apr 25 11:26:34 PDT 2012


On Wed, Apr 25, 2012 at 9:27 AM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Apr 25, 2012, at 5:53 AM, Jay Foad wrote:
> > Hi,
> >
> > When building lld with gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 I get:
> >
> > [100%] Building CXX object
> >
> projects/lld/lib/Platforms/Darwin/CMakeFiles/lldDarwinPlatform.dir/ExecutableWriter.cpp.o
> >
> /home/jay/svn/llvm-project/llvm/trunk/projects/lld/lib/Platforms/Darwin/ExecutableWriter.cpp:338:3:
> > error: a class-key must be used when declaring a friend
> >
> /home/jay/svn/llvm-project/llvm/trunk/projects/lld/lib/Platforms/Darwin/ExecutableWriter.cpp:338:3:
> > error: friend declaration does not name a class or function
> >
> /home/jay/svn/llvm-project/llvm/trunk/projects/lld/lib/Platforms/Darwin/ExecutableWriter.cpp:339:3:
> > error: a class-key must be used when declaring a friend
> >
> /home/jay/svn/llvm-project/llvm/trunk/projects/lld/lib/Platforms/Darwin/ExecutableWriter.cpp:339:3:
> > error: friend declaration does not name a class or function
> >
> > The attached patch fixes this. OK to commit?
> Yes.
>

This is a C++11 feature (which apparently g++4.6 does not support). I have
no idea whether lld intends to support g++4.6.

Is this something clang should be warning about too?


It does, under -Wc++98-compat.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120425/5902c748/attachment.html>


More information about the llvm-commits mailing list