<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - warn_no_constructor_for_refconst can not be disabled (Boost.ConceptCheck)"
href="https://bugs.llvm.org/show_bug.cgi?id=41759">41759</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>warn_no_constructor_for_refconst can not be disabled (Boost.ConceptCheck)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mateusz@loskot.net
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The warn_no_constructor_for_refconst (and possibly other from close category)
can not be disabled as there is no corresponding `-Wno` flag available in
clang++<=9.
This causes issues while compiling code that makes use of Boost.ConceptCheck
library. For example:
```
#include <boost/concept_check.hpp>
int main()
{
using T = int const&;
boost::function_requires
<
boost::EqualityComparableConcept<T>
>();
}
```
will trigger a flood of warnings:
```
$ clang++ -std=c++11 -I/mnt/d/boost.wsl
clang_warn_no_constructor_for_refconst.cpp
In file included from clang_warn_no_constructor_for_refconst.cpp:1:
/mnt/d/boost.wsl/boost/concept_check.hpp:231:17: warning: struct
'EqualityComparable<const int &>' does not declare any constructor
to initialize its non-modifiable members
BOOST_concept(EqualityComparable,(TT))
^
/mnt/d/boost.wsl/boost/concept_check.hpp:231:17: note: in instantiation of
template class 'boost::EqualityComparable<const int &>'
requested here
/mnt/d/boost.wsl/boost/concept/detail/has_constraints.hpp:32:63: note: in
instantiation of template class
'boost::EqualityComparableConcept<const int &>' requested here
inline yes has_constraints_(Model*,
wrap_constraints<Model,&Model::constraints>* = 0);
^
/mnt/d/boost.wsl/boost/concept/detail/has_constraints.hpp:44:25: note: while
substituting deduced template arguments into function
template 'has_constraints_' [with Model =
boost::EqualityComparableConcept<const int &>]
, value = sizeof( detail::has_constraints_((Model*)0) ) ==
sizeof(detail::yes) );
^
/mnt/d/boost.wsl/boost/concept/detail/general.hpp:53:19: note: in instantiation
of template class
'boost::concepts::not_satisfied<boost::EqualityComparableConcept<const
int &> >' requested here
concepts::not_satisfied<Model>::value
^
/mnt/d/boost.wsl/boost/concept_check.hpp:50:7: note: in instantiation of
template class 'boost::concepts::requirement_<void
(*)(boost::EqualityComparableConcept<const int &>)>' requested here
BOOST_CONCEPT_ASSERT((Model));
^
/mnt/d/boost.wsl/boost/concept/assert.hpp:43:5: note: expanded from macro
'BOOST_CONCEPT_ASSERT'
BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
^
/mnt/d/boost.wsl/boost/concept/detail/general.hpp:71:25: note: expanded from
macro 'BOOST_CONCEPT_ASSERT_FN'
&::boost::concepts::requirement_<ModelFnPtr>::failed> \
^
clang_warn_no_constructor_for_refconst.cpp:6:12: note: in instantiation of
function template specialization
'boost::function_requires<boost::EqualityComparableConcept<const int &>
<span class="quote">>' requested here</span >
boost::function_requires
^
/mnt/d/boost.wsl/boost/concept_check.hpp:238:8: note: reference member 'a' will
never be initialized
TT a, b;
^
/mnt/d/boost.wsl/boost/concept_check.hpp:238:11: note: reference member 'b'
will never be initialized
TT a, b;
^
1 warning generated.
```
There is no way to disable this
```
warning: struct 'EqualityComparable<const int &>' does not declare any
constructor to initialize its non-modifiable members
```
Although I understand and agree with rationale provided by Chandler here
<a href="https://softwareengineering.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development/124574#124574">https://softwareengineering.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development/124574#124574</a>,
to warning about "never really correct" code, I think that in this particular
use case of the Boost.ConceptCheck library, it is Okey to expect to be able to
disable the warn_no_constructor_for_refconst (and similar).
The PITA is that for any non-trivial size of templated library that makes use
of Boost.ConceptCheck, compilation with Clang leads to a flood of warning.
As side effect, it causes trouble when compiling on popular CI services
available for open source projects (timeouts, builds killed due to logs too
long etc.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>