[Bug c++/68061] Can't use [[deprecated]] with requires clause

2021-08-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek  ---
This is because with -fconcepts-ts the requires-clause argument is parsed as
logical-or-expression rather than constraint-logical-or-expression and for the
former the [ could be part of postfix-expression in there.  Bet that is the
reason why constraint-logical-or-expression exists and allows only
primary-expressions mixed with ||s and &
Perhaps the FE could have a hack, set some parser flag when parsing
requires-clause and in postfix-expression parsing if that flag is set instead
of the [[ error in there pretend [ is not there and ends the expression.

As a workaround,
template 
  requires true
void f [[deprecated]] (T);
works.

[Bug c++/68061] Can't use [[deprecated]] with requires clause

2021-08-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

--- Comment #5 from Jonathan Wakely  ---
This bug is still present on trunk when -fconcepts-ts is used, even in C++20
mode:

$ g++ -c 68061.C -std=c++20 
$ g++ -c 68061.C -std=c++20 -fconcepts-ts
68061.C:3:1: error: two consecutive ‘[’ shall only introduce an attribute
before ‘[’ token
3 | [[deprecated]] void f(T);
  | ^

It also affects [[nodiscard]] and so caused PR 101782.

[Bug c++/68061] Can't use [[deprecated]] with requires clause

2020-02-15 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

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

https://gcc.gnu.org/g:acff02ef1f4bc951ab7b4e3fdc117e0646d5d8f5

commit r10-6650-gacff02ef1f4bc951ab7b4e3fdc117e0646d5d8f5
Author: Jason Merrill 
Date:   Sat Feb 15 15:11:01 2020 +0100

c++: Add test for PR 68061.

PR c++/68061
* g++.dg/concepts/attrib1.C: New.

[Bug c++/68061] Can't use [[deprecated]] with requires clause

2020-02-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-02-13
  Known to work||10.0
 Blocks||67491
 Ever confirmed|0   |1
  Known to fail||9.2.0

--- Comment #3 from Jonathan Wakely  ---
This was fixed for GCC 10 by r276764.

It still fails on the release branches. I'm not sure if there's a test to
detect regressions.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

[Bug c++/68061] Can't use [[deprecated]] with requires clause

2015-11-01 Thread Casey at Carter dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

Casey Carter  changed:

   What|Removed |Added

 CC||Casey at Carter dot net

--- Comment #2 from Casey Carter  ---
Reduced test case:

template 
  requires true
[[deprecated]] void f(T);

[Bug c++/68061] Can't use [[deprecated]] with requires clause

2015-10-23 Thread chrisb2244 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68061

--- Comment #1 from Christian Butcher  ---
Created attachment 36565
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36565=edit
Short compilable (or not) case showing problem

Commenting out the function definition for 'foo' allows compilation using 
g++ -std=c++1z reqClauseDep.cpp -o Test