Skip to content

reference_wrapper doesn't handle function pointers with C-style varargs #35012

@mclow

Description

@mclow
Bugzilla Link 35664
Version unspecified
OS All
CC @mclow,@jwakely

Extended Description

The following code should compile, but doesn't

#include <functional>

int f(const char*, ...) { return 0; }
std::reference_wrapper fr{f};
decltype(fr)::result_type i;

struct X {
    int f(const char*, ...) { return 0; }
};
auto xf = &X::f;
std::reference_wrapper xfr{xf};
decltype(xfr)::result_type j;

int main() {}

Reported by Jonathan Wakeley

Metadata

Metadata

Labels

bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.rejects-valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions