brintos

brintos / llvm-project-archived public Read only

0
0
Text · 796 B · 8287197 Raw
28 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++0310 11// <functional>12 13// class function<R(ArgTypes...)>14 15// R operator()(ArgTypes... args) const16 17#include <functional>18#include <cassert>19 20// member data pointer: cv qualifiers should transfer from argument to return type21 22struct Foo { int data; };23 24void f() {25    int Foo::*fp = &Foo::data;26    std::function<int& (const Foo*)> r2(fp); // expected-error {{no matching constructor for initialization of}}27}28