[Bug c++/67727] New: [concepts] parameterized constraint not being checked for unused variables
ryan.burn at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Sep 26 21:05:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67727
Bug ID: 67727
Summary: [concepts] parameterized constraint not being checked
for unused variables
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ryan.burn at gmail dot com
Target Milestone: ---
The following code prints 1 1, but according to
http://stackoverflow.com/questions/32801326/in-requires-parameter-lists-can-you-introduce-types-that-result-in-substitution
should print 1 0
/////////////////////////////////////////////////////////////////////////
#include <iterator>
#include <iostream>
template <class Iter>
concept bool Iterator =
requires(Iter i, typename std::iterator_traits<Iter>::value_type val,
typename std::iterator_traits<Iter>::reference ref) {
++i;
};
int main() {
std::cout << Iterator<int*> << "\n"; // prints 1
std::cout << Iterator<int> << "\n"; // prints 1
return 0;
}
/////////////////////////////////////////////////////////////////////////
More information about the Gcc-bugs
mailing list