[llvm] r272767 - Speculative buildbot fix.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 00:07:53 PDT 2016


Looks like it works with clang so I've given it a shot in r272875. Let's
see how the bots like it.

On Wed, Jun 15, 2016 at 8:01 AM, Reid Kleckner <rnk at google.com> wrote:

> MSVC 2015 was able to build it with a friend function definition. See
> attached patch. No implied warranty, you should probably test it with GCC
> first. :)
>
> On Wed, Jun 15, 2016 at 2:17 AM, Sean Silva via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> A small example of the issue here is:
>>
>> ```
>> namespace foo {
>> class Foo {
>>   class Contained {
>>     int x;
>>   };
>>
>>   friend void bar(Foo::Contained &);
>> };
>> // Is this needed? GCC and ICC think so. Clang disagrees.
>> //void bar(Foo::Contained &);
>> }
>>
>> void foo::bar(Foo::Contained &) {
>> }
>> ```
>>
>> Testing a couple compilers at https://godbolt.org/g/kNmQhB it seems like
>> clang does not need the extra declaration inside the namespace but gcc and
>> icc do.
>>
>> I think it is this question also:
>> http://stackoverflow.com/questions/16718166/friend-function-declaration-definition-inside-a-namespace
>>
>> -- Sean Silva
>>
>> On Wed, Jun 15, 2016 at 2:00 AM, Sean Silva via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> Author: silvas
>>> Date: Wed Jun 15 04:00:33 2016
>>> New Revision: 272767
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=272767&view=rev
>>> Log:
>>> Speculative buildbot fix.
>>>
>>> This wasn't failing for me with clang as the compiler. I think GCC may
>>> disagree with clang about whether a friend declaration introduces a
>>> declaration in the enclosing namespace (or something).
>>>
>>> Example error:
>>>
>>> /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:950:77:
>>> error: ‘llvm::raw_ostream&
>>> llvm::slpvectorizer::operator<<(llvm::raw_ostream&, const
>>> llvm::slpvectorizer::BoUpSLP::ScheduleData&)’ should have been declared
>>> inside ‘llvm::slpvectorizer’
>>>                                               const
>>> BoUpSLP::ScheduleData &SD) {
>>>
>>>      ^
>>>
>>> Modified:
>>>     llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
>>>
>>> Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=272767&r1=272766&r2=272767&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
>>> +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Wed Jun 15
>>> 04:00:33 2016
>>> @@ -942,6 +942,11 @@ private:
>>>    /// can legally be represented.
>>>    MapVector<Value *, uint64_t> MinBWs;
>>>  };
>>> +
>>> +#ifndef NDEBUG
>>> +raw_ostream &operator<<(raw_ostream &os, const BoUpSLP::ScheduleData
>>> &SD);
>>> +#endif
>>> +
>>>  } // end namespace llvm
>>>  } // end namespace slpvectorizer
>>>
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160616/9e17d779/attachment.html>


More information about the llvm-commits mailing list