Bug 98717 - [10 Regression] [c++20] variadic concept can't take empty pack
Summary: [10 Regression] [c++20] variadic concept can't take empty pack
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 10.3
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2021-01-18 00:14 UTC by Ryan Greenblatt
Modified: 2022-05-12 21:03 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 9.3.0
Known to fail: 10.2.0, 11.0
Last reconfirmed: 2021-01-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Greenblatt 2021-01-18 00:14:46 UTC
```
template<typename... T>
concept True = true;

static_assert(True<>);
```
"error: invalid use concept ‘True<>’"

https://godbolt.org/z/ndfjzj

I'm suprised this hasn't been caught already... (assuming there isn't a duplicate bug report I missed)
Comment 1 Patrick Palka 2021-01-19 01:57:33 UTC
Confirmed.  We went from accepting to rejecting this testcase after r276764, aka the C++20 concepts merge.
Comment 2 CVS Commits 2021-02-04 20:43:50 UTC
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:4e7c24d97dd65083a770252ce942f43d408fe11d

commit r11-7106-g4e7c24d97dd65083a770252ce942f43d408fe11d
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Feb 4 11:46:45 2021 -0500

    c++: Empty args for variadic concept [PR98717]
    
    Nice when fixing a bug is as easy as removing incorrect checks.
    
    gcc/cp/ChangeLog:
    
            PR c++/98717
            * constraint.cc (build_concept_check_arguments): Remove assert.
            (build_concept_check): Allow empty args.
    
    gcc/testsuite/ChangeLog:
    
            PR c++/98717
            * g++.dg/cpp2a/concepts-variadic3.C: New test.
Comment 3 CVS Commits 2021-02-05 01:02:08 UTC
The releases/gcc-10 branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r10-9348-geb15f761bc741599504d532ef9c1c03a8de71820
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Feb 4 11:46:45 2021 -0500

    c++: Empty args for variadic concept [PR98717]
    
    Nice when fixing a bug is as easy as removing incorrect checks.
    
    gcc/cp/ChangeLog:
    
            PR c++/98717
            * constraint.cc (build_concept_check_arguments): Remove assert.
            (build_concept_check): Allow empty args.
    
    gcc/testsuite/ChangeLog:
    
            PR c++/98717
            * g++.dg/cpp2a/concepts-variadic3.C: New test.
Comment 4 Richard Biener 2021-04-08 12:02:13 UTC
GCC 10.3 is being released, retargeting bugs to GCC 10.4.
Comment 5 Jason Merrill 2022-05-12 21:03:42 UTC
Fixed in 10.3.