Bug 75505

Summary: [clover] Build failure with clang 3.4 and libc++
Product: Mesa Reporter: Jean-Sébastien Pédron <dumbbell>
Component: OtherAssignee: mesa-dev
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: 10.1   
Hardware: x86-64 (AMD64)   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Build failure with clang 3.4

Description Jean-Sébastien Pédron 2014-02-25 18:35:24 UTC
Created attachment 94726 [details]
Build failure with clang 3.4

Clover from Mesa 10.1-rc2 fails to build when using clang 3.4 and libc++, instead of GCC 4.7+ and libstdc++.
 
I first apply the patch available in #74098, 3rd comment to fix a previous build failure.

The output is attached.
Comment 1 Jean-Sébastien Pédron 2014-02-25 20:13:36 UTC
I found out a difference between GCC's "functional" header and libc++'s one:

  - in GCC, all "operator()" methods are const:
    operator()(...) const

  - in libc++, they aren't:
    operator() (_ArgTypes&&... __args)

Changing the above line to:
  operator() (_ArgTypes&&... __args) const
fixes the build.

I have zero knowledge of C++, so I'm not sure that's a valid fix.
Comment 2 Francisco Jerez 2014-02-25 21:12:55 UTC
(In reply to comment #1)
> I found out a difference between GCC's "functional" header and libc++'s one:
> 
>   - in GCC, all "operator()" methods are const:
>     operator()(...) const
> 
>   - in libc++, they aren't:
>     operator() (_ArgTypes&&... __args)
> 
> Changing the above line to:
>   operator() (_ArgTypes&&... __args) const
> fixes the build.
> 
> I have zero knowledge of C++, so I'm not sure that's a valid fix.

Right, this is a bug in libc++'s implementation of mem_fn().  It seems to have been fixed already in r199848.  You should try a more recent version of libc++.

Thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.