[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2022-04-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:1de6612d994ada8edaab18bbc6afd8e9a57413aa

commit r12-7997-g1de6612d994ada8edaab18bbc6afd8e9a57413aa
Author: Jason Merrill 
Date:   Sun Mar 27 22:31:51 2022 -0400

c++: elaborated-type-spec in requires-expr [PR101677]

We were failing to declare class S in the global namespace because we were
treating the requires-expression parameter scope as a normal block scope,
so
the implicit declaration went there.

It seems to me that the requires parameter scope is more like a function
parameter scope (not least in the use of the word "parameter"), so let's
change the scope kind.  But then we need to adjust the prohibition on
placeholders declaring implicit template parameters.

PR c++/101677

gcc/cp/ChangeLog:

* name-lookup.h (struct cp_binding_level): Add requires_expression
bit-field.
* parser.cc (cp_parser_requires_expression): Set it.
(synthesize_implicit_template_parm): Check it.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-pr67178.C: Adjust error.
* g++.dg/cpp2a/concepts-requires28.C: New test.

[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2022-04-01 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2022-01-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2021-07-30 Thread joeloser93 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

--- Comment #2 from Joe Loser  ---
(In reply to Andrew Pinski from comment #1)
> >This bug can be worked around by using a complete type instead when defining 
> >the concept. 
> 
> It does not even have to be complete type; just defined before.
> So adding:
> class S;
> at the begining causes GCC to accept the code.

Yep, you're right. That's actually what I use in my codebase as a workaround. I
misspoke in the description -- sorry about that. Updated Godbolt link is at
https://godbolt.org/z/KGq48WYq4

[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2021-07-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-30

--- Comment #1 from Andrew Pinski  ---
>This bug can be worked around by using a complete type instead when defining 
>the concept. 

It does not even have to be complete type; just defined before.
So adding:
class S;
at the begining causes GCC to accept the code.

[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

2021-07-30 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

Richard Biener  changed:

   What|Removed |Added

Summary|[11 Regression] Concept |[11/12 Regression] Concept
   |with use of incomplete type |with use of incomplete type
   |succeeds on GCC 10.3.0, |succeeds on GCC 10.3.0,
   |fails on GCC 11 onward  |fails on GCC 11 onward
  Known to work||10.3.0
   Target Milestone|--- |11.3
   Keywords||rejects-valid