Opened 13 years ago

Closed 12 years ago

#3617 closed Bugs (worksforme)

big warnings from simple use of Boost.Concept_check

Reported by: Eric Niebler Owned by: jsiek
Milestone: Boost 1.42.0 Component: concept_check
Version: Boost Development Trunk Severity: Cosmetic
Keywords: warning concept check Cc:

Description

The following code causes at least msvc and gcc to complain loudly:

#include <boost/concept_check.hpp>
#include <boost/concept/requires.hpp>

template<typename T>
BOOST_CONCEPT_REQUIRES(
    ((boost::UnaryFunction<T, void, int &>)), (void))
foo(T const &)
{
}

void bar(int &) {}

int main()
{
    foo(&bar);
}

The problem is that the definition of UnaryFunction (and most of the concepts) causes a non-static reference data member in a class without a constructor.

Change History (1)

comment:1 by Jeremiah Willcock, 12 years ago

Resolution: worksforme
Status: newclosed

This produces no warnings (other than for long long) with GCC 4.5.0 -ansi -pedantic -Wall -Wextra for either Boost trunk or release branches.

Note: See TracTickets for help on using tickets.