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

Justin Bogner mail at justinbogner.com
Thu May 22 23:20:53 PDT 2014


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

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?




More information about the cfe-commits mailing list