r208825 - PR19742: cv-qualifiers and ref-qualifiers aren't allowed on functions within

Marshall Clow mclow.lists at gmail.com
Tue May 27 10:10:01 PDT 2014


On May 22, 2014, at 11:20 PM, Justin Bogner <mail at justinbogner.com> wrote:

> Richard Smith <richard at metafoo.co.uk> writes:
>> On Wed, May 21, 2014 at 8:57 PM, Justin Bogner <mail at justinbogner.com> wrote:
>>      #include <functional>
>>      struct A {
>>          int foo(int) const { return 1; }
>>      };
>>      void foo() {
>>          std::function<int(const A*, int)> f = &A::foo;
>>      }
>> 
>>    This no longer compiles. Is it a problem in libc++, or with this change?
>> 
>> This is a bug in libc++'s is_function implementation; it doesn't do the right
>> thing for function types with cv-qualifiers or a ref-qualifier.
> 
> Okay, so if I understand correctly, the change in behaviour is that this
> should return true and is now returning false:
> 
>  std::is_function<int (int) const>::value

Actually, what I’m seeing is that const member functions are failing to compile:

	std::is_member_function_pointer<A::void (*) (int) const>::value

> and the problem is that your change has exposed a bug in libc++ where
> itt isn't doing the right thing here. Is this correct?

I’m willing to believe that - but I’m still investigating.

— Marshall





More information about the cfe-commits mailing list