Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC PR 67225: Concepts break access control #102

Open
Kannen opened this issue Jun 5, 2017 · 3 comments
Open

GCC PR 67225: Concepts break access control #102

Kannen opened this issue Jun 5, 2017 · 3 comments

Comments

@Kannen
Copy link

Kannen commented Jun 5, 2017

Gcc silently bugs when appears a declaration involving a placeholder that is a partial concept specialization as in:

template<Sentinel<I> T>
void foo();

After having read such a declaration, gcc does not perfom any more any access violation check. This simple piece of code should not compile:

#include <stl2/algorithm.hpp>
class a_class
   {
   void f() {}//private
   };
int main()
  {
  a_class{}.f();//access private member, accepted by gcc
  }

Their are maybe much more silent failures caused by this bug.

You can reproduce test this gcc bug with this peace of code. The bug exist since gcc6.1. gcc7.1.1 is still bugged.

template<class ,class >
concept bool Same = false;
template<class T>
concept bool Other = requires(T a)
  {
  {a + a} -> Same<T>;
  };
class A
  {
  void f(){};
  };

int main()
{
A{}.f(); //private member access accepted
}
@CaseyCarter
Copy link
Owner

I think this is another instance of GCC PR 78715, but I'll keep this issue open until the bug is resolved so I can make sure.

@CaseyCarter CaseyCarter changed the title Issue with gcc Concepts break access control Jul 2, 2017
@Kannen
Copy link
Author

Kannen commented Jul 6, 2017

I had post this bug GCC PR 80962. I do not know haw bug report can be merged.

Now I think the issue is broader. This gcc buggy behavior can also happens if a concept appears in a if constexpr.

@CaseyCarter CaseyCarter changed the title Concepts break access control GCC PR 67225: Concepts break access control Aug 14, 2018
@CaseyCarter
Copy link
Owner

I think this is another instance of GCC PR 78715, but I'll keep this issue open until the bug is resolved so I can make sure.

Which is a duplicate of GCC PR 67225.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants