MSVC C4180 warning
- Dominant language
- C++
- Stars
- 23
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Code:
```cpp
#include
#include
#include
void fun(int) {}
int main()
{
namespace qi = boost::spirit::qi;
char const *s = "42", *e = s + std::strlen(s);
qi::parse(s, e, qi::int_[fun]);
}
```
Warning message:
```
1>boost/proto/extends.hpp(552): warning C4180: qualifier applied to function type has no meaning; ignored
1>main.cpp(11): note: see reference to function template instantiation 'const boost::proto::exprns_::expr boost::proto::exprns_::extends,0>,boost::spirit::terminal,boost::proto::domainns_::default_domain,0>::operator [](A (__cdecl &)) const' being compiled
1> with
1> [
1> Tag=boost::proto::tagns_::tag::subscript,
1> Args=boost::proto::argsns_::list2 &,boost::proto::exprns_::expr,0>>,
1> T=boost::spirit::tag::int_,
1> A=void (int)
1> ]
1>main.cpp(11): note: see reference to function template instantiation 'const boost::proto::exprns_::expr boost::proto::exprns_::extends,0>,boost::spirit::terminal,boost::proto::domainns_::default_domain,0>::operator [](A (__cdecl &)) const' being compiled
1> with
1> [
1> Tag=boost::proto::tagns_::tag::subscript,
1> Args=boost::proto::argsns_::list2 &,boost::proto::exprns_::expr,0>>,
1> T=boost::spirit::tag::int_,
1> A=void (int)
1> ]
```
MWE:
```cpp
#define BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
#include
struct placeholder {};
void fun() {}
namespace proto = boost::proto;
template
struct eterm : proto::extends >
{
typedef proto::extends > base_type;
eterm(Expr const& expr = Expr())
: base_type(expr)
{}
BOOST_PROTO_EXTENDS_USING_ASSIGN(eterm)
};
int main()
{
{
proto::terminal::type term;
term[fun]; // produces C4180 warning
term(fun); // produces C4180 warning
term = fun; // produces C4180 warning
term + fun; // fine
}
{
eterm::type> term;
term[fun]; // produces C4180 warning
term(fun); // produces C4180 warning
term = fun; // produces C4180 warning
term + fun; // fine
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.