[llvm] r272767 - Speculative buildbot fix.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 02:17:15 PDT 2016


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/5946f6d4/attachment-0001.html>


More information about the llvm-commits mailing list