From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28E693870872; Fri, 28 Aug 2020 08:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28E693870872 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598603942; bh=EqxJtW8uA9I9HJSTaNVQBS7U/dVy+mc4HcMwN+rL/Sw=; h=From:To:Subject:Date:From; b=K55/nsGNOm9vGD6gVoulUSIvvCtP/g2VTPocPYIkNUkzhsCvo8ugm6TaFcSbDceoV Q3WiksNAKT7tb95DZG6GmNo8c7wT+wccj24VPjj6C+H1xbR4Ntv7wYbT9hKcjGwzTD u24xWab7Dw81icyfyYCfL1u9BrZ4A8KKJronSDc8= From: "p.hyundeok76 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96830] New: GCC does not complain template-head containing requires clause Date: Fri, 28 Aug 2020 08:39:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: p.hyundeok76 at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: Fri, 28 Aug 2020 08:39:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96830 Bug ID: 96830 Summary: GCC does not complain template-head containing requires clause Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: p.hyundeok76 at gmail dot com Target Milestone: --- Created attachment 49145 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49145&action=3Dedit output of g++-10 -v -save-temps -std=3Dc++2a test.cpp Summary When the member of a class template containing requires clause is defined outside the class, the code compiles although the definition does not speci= fy the requires clause. Consider the code snippet below: template requires std::integral class Foo { public: void func(); }; template void Foo::func() {} As shown above, the definition of Foo::func does not contain requires clause. But it compiles without an error. When compiled with clang, it complains. - version of GCC (tested on two machines) 1. Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none:hsa OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 9.3.0-10ub= untu2' --with-bugurl=3Dfile:///usr/share/doc/gcc-9/README.Bugs --enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix= =3D/usr --with-gcc-major-version-only --program-suffix=3D-9 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-= debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=3Dauto --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --with-arch-32= =3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none,hsa --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2) 2. Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=3D/usr --libdir=3D/u= sr/lib --libexecdir=3D/usr/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/in= fo --with-bugurl=3Dhttps://bugs.archlinux.org/ --enable-languages=3Dc,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build= -id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=3D/usr/include/dlang/gdc Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.0 (GCC) - system (output of uname -a excluding dates) 1. 4.4.0-18362-Microsoft #836-Microsoft x86_64 x86_64 x86_64 GNU/Linux 2. Linux arch 5.8.3-arch1-1 x86_64 GNU/Linux - options used for compilation -std=3Dc++2a - command line that triggers the bug g++ -std=3Dc++2a test.cpp - compiler output Nothing - preprocessed file (generated on the first system) test.ii=