https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78715
Bug ID: 78715
Summary: [concepts] Access specifiers ignored after concept
declaration
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tcbrindle at gmail dot com
Target Milestone: ---
Whilst playing with Casey Carter's STL2 implementation, I noticed an odd
phenomenon: after including a particular file, I was able to call private
functions of classes when I should not have been able to. After digging around,
I managed to boil it down to a short test case:
template <class>
concept bool Dummy = true;
template <typename>
class example {
template <Dummy<> U>
friend auto func();
};
class test {
test() = default;
};
int main()
{
test t;
}
This code compiles without warnings on GCC 6.2.0, whereas I would expect an
error due to calling the private default constructor of `test`. Modifying the
concept code (e.g. making `example` a non-template) produces the expected
error message.
I've got no idea what's going on, but if you need any more info then please let
me know.