[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

Martin Liška  changed:

   What|Removed |Added

   Keywords|needs-bisection |

--- Comment #9 from Martin Liška  ---
Just for the record, started with r10-3735-gcb57504a55015891.

[Bug c++/83000] Constraints for union-templates do not work

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

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #8 from Jonathan Wakely  ---
(In reply to ensadc from comment #1)
> Possible duplicate of issue 67217

Yes, I think so.

*** This bug has been marked as a duplicate of bug 67217 ***

[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

--- Comment #7 from Andrew Pinski  ---
(In reply to Martin Liška from comment #6)
> $ g++ --version
> g++ (GCC) 12.0.0 20211208 (experimental)
> 
> $ g++ pr83000.C -c -fconcepts
> pr83000.C: In function ‘int main()’:
> pr83000.C:6:18: error: template constraint failure for ‘template 
> requires  sizeof (T) > 1 union Test’
> 6 | Test x;
>   |  ^
> pr83000.C:6:18: note: constraints not satisfied
> pr83000.C: In substitution of ‘template  requires  sizeof (T) > 1
> union Test [with T = char]’:
> pr83000.C:6:18:   required from here
> pr83000.C:3:11:   required by the constraints of ‘template 
> requires  sizeof (T) > 1 union Test’
> pr83000.C:2:25: note: the expression ‘sizeof (T) > 1 [with T = char]’
> evaluated to ‘false’
> 2 | requires (sizeof(T) > 1)
>   |  ~~~^~~~

Right, it is supposed to be rejected like that as sizeof(char) < 1 is false. 
GCC 9 accepted the code.

[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

--- Comment #6 from Martin Liška  ---
$ g++ --version
g++ (GCC) 12.0.0 20211208 (experimental)

$ g++ pr83000.C -c -fconcepts
pr83000.C: In function ‘int main()’:
pr83000.C:6:18: error: template constraint failure for ‘template 
requires  sizeof (T) > 1 union Test’
6 | Test x;
  |  ^
pr83000.C:6:18: note: constraints not satisfied
pr83000.C: In substitution of ‘template  requires  sizeof (T) > 1
union Test [with T = char]’:
pr83000.C:6:18:   required from here
pr83000.C:3:11:   required by the constraints of ‘template  requires 
sizeof (T) > 1 union Test’
pr83000.C:2:25: note: the expression ‘sizeof (T) > 1 [with T = char]’ evaluated
to ‘false’
2 | requires (sizeof(T) > 1)
  |  ~~~^~~~

$ g++ pr83000.C -c -std=c++2a
pr83000.C: In function ‘int main()’:
pr83000.C:6:18: error: template constraint failure for ‘template 
requires  sizeof (T) > 1 union Test’
6 | Test x;
  |  ^
pr83000.C:6:18: note: constraints not satisfied
pr83000.C: In substitution of ‘template  requires  sizeof (T) > 1
union Test [with T = char]’:
pr83000.C:6:18:   required from here
pr83000.C:3:11:   required by the constraints of ‘template  requires 
sizeof (T) > 1 union Test’
pr83000.C:2:25: note: the expression ‘sizeof (T) > 1 [with T = char]’ evaluated
to ‘false’
2 | requires (sizeof(T) > 1)
  |  ~~~^~~~

[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Martin Liška from comment #3)
> > (In reply to Andrew Pinski from comment #2)
> > > Seems fixed in GCC 10.
> > 
> > Are you sure, all releases I have reject the code.
> 
> You need -std=c++2a or -std=c++20 or -fconcepts to support concepts :).

GCC 9 does not enable concepts for -std=c++2a so you need  -fconcepts really.

[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #4 from Andrew Pinski  ---
(In reply to Martin Liška from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > Seems fixed in GCC 10.
> 
> Are you sure, all releases I have reject the code.

You need -std=c++2a or -std=c++20 or -fconcepts to support concepts :).

[Bug c++/83000] Constraints for union-templates do not work

2021-12-08 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2021-12-08
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Martin Liška  ---
(In reply to Andrew Pinski from comment #2)
> Seems fixed in GCC 10.

Are you sure, all releases I have reject the code.
With the current master:

g++ pr83000.C -c
pr83000.C:2:14: error: expected constructor, destructor, or type conversion
before ‘(’ token
2 | requires (sizeof(T) > 1)
  |  ^
pr83000.C: In function ‘int main()’:
pr83000.C:6:9: error: ‘Test’ was not declared in this scope
6 | Test x;
  | ^~~~
pr83000.C:6:14: error: expected primary-expression before ‘char’
6 | Test x;
  |  ^~~~

[Bug c++/83000] Constraints for union-templates do not work

2021-08-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||10.1.0
   Keywords||accepts-invalid

--- Comment #2 from Andrew Pinski  ---
Seems fixed in GCC 10.

[Bug c++/83000] Constraints for union-templates do not work

2017-11-16 Thread ensadc at mailnesia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83000

ensadc at mailnesia dot com changed:

   What|Removed |Added

 CC||ensadc at mailnesia dot com

--- Comment #1 from ensadc at mailnesia dot com ---
Possible duplicate of issue 67217