From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 338143858031; Sat, 11 Dec 2021 05:00:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 338143858031 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/81202] Concept parsing error for default template arguments Date: Sat, 11 Dec 2021 05:00:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2021 05:00:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81202 --- Comment #2 from Andrew Pinski --- Full testcase: #include #include template constexpr bool IsPtrC=3Dstd::is_pointer_v&&(std::is_same_v ||std::is_same_v>); template concept IsPtrC2=3DIsPtrC; template using TEST=3Dint; int main(int argc,char*argv[]){ TEST> i;//OK TEST> j;//error: parse error in template argument list TEST> k;//OK TEST<(IsPtrC2)> l;//OK } With -std=3Dc++20 the above code works (as expected) but with -std=3Dc++17 -fconcepts it fails (with GCC 10+). I will let a C++ maintainer to decide if it should work with -std=3Dc++17 -fconcepts or not. The error message is: : In function 'int main(int, char**)': :10:19: error: type/value mismatch at argument 1 in template parame= ter list for 'template using TEST =3D int' 10 | TEST> j;//error: parse error in template argument li= st | ^~ :10:19: note: expected a constant of type 'bool', got 'auto [requ= ires IsPtrC2<, int>]' Compiler returned: 1=