From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C35703858430; Sun, 9 Oct 2022 00:29:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C35703858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665275366; bh=AS2rOyPpQxDUFWIYQVkAokKVheO4inEZx861ayyDooQ=; h=From:To:Subject:Date:From; b=f0O1rKknJ6OlMa9cxtWpzVfrzRGJNl3vo8xjNiYQaj5qmZNtmKSLr04zBwbCIKPhm tWJCfzCbC/dCi1549UKbtNqd4PBRQOzo60ERKdRwwP9xa6zIXr7BIJ5dZHwBWK+k4J L9Knyw+dlL7VTFYOihtsQI9RonyObhOAae7w9Wac= From: "Mark_B53 at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107188] New: using concept type-constraint declared in nested namespace causes incorrect compilation error Date: Sun, 09 Oct 2022 00:29:15 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Mark_B53 at yahoo 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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107188 Bug ID: 107188 Summary: using concept type-constraint declared in nested namespace causes incorrect compilation error Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Mark_B53 at yahoo dot com Target Milestone: --- #include #include #include namespace ns1 { template concept RangeV =3D std::ranges::range && std::same_as, V>; } namespace ns2 { ns1::RangeV auto fn() { return std::vector{}; } // compiles struct X { ns1::RangeV auto fn() { return std::vector{}; } // fails to compile (bug!) }; using ns1::RangeV; struct Y { RangeV auto fn() { return std::vector{}; } // compiles }; } ----- :11:10: error: wrong number of template arguments (1, should be 2) 11 | ns1::RangeV auto fn() { return std::vector{}; } // f= ails to compile (bug!) | ^~~~~~~~~~~ :6:9: note: provided for 'template concept ns1::RangeV' 6 | concept RangeV =3D std::ranges::range && std::same_as, V>; ----- g++ a.cpp -std=3Dc++20 Using built-in specs. COLLECT_GCC=3D/opt/compiler-explorer/gcc-snapshot/bin/g++ Target: x86_64-linux-gnu Configured with: ../gcc-trunk-20221008/configure --prefix=3D/opt/compiler-explorer/gcc-build/staging --build=3Dx86_64-linux-= gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu --disable-bootstrap --enable-multiarch --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --enable-clocale=3Dgnu --enable-languages=3Dc,c++,fortran,ada,objc,obj-c++,d --enable-ld=3Dyes --enable-gold=3Dyes --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-linker-build-id --enable-lto --enable-plugins --enable-threads=3Dp= osix --with-pkgversion=3DCompiler-Explorer-Build-gcc-895dd027d5dda51a95d242aec8a= 49a6dfa5db58d-binutils-2.38 --enable-libstdcxx-backtrace=3Dyes Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20221007 (experimental) (Compiler-Explorer-Build-gcc-895dd027d5dda51a95d242aec8a49a6dfa5db58d-binut= ils-2.38)=20 COLLECT_GCC_OPTIONS=3D'-fdiagnostics-color=3Dalways' '-g' '-o' '/app/output= .s' '-masm=3Dintel' '-S' '-v' '-std=3Dc++20' '-isystem' '/opt/compiler-explorer/libs/boost_1_80_0' '-shared-libgcc' '-mtune=3Dgener= ic' '-march=3Dx86-64' '-dumpdir' '/app/' /opt/compiler-explorer/gcc-trunk-20221008/bin/../libexec/gcc/x86_64-linux-g= nu/13.0.0/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -iprefix /opt/compiler-explorer/gcc-trunk-20221008/bin/../lib/gcc/x86_64-linux-gnu/1= 3.0.0/ -D_GNU_SOURCE -isystem /opt/compiler-explorer/libs/boost_1_80_0 -q= uiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext .cpp -masm=3Dintel -mtune=3Dgeneric -march=3Dx86-64 -g -std=3Dc++20 -version -fdiagnostics-col= or=3Dalways -o /app/output.s GNU C++20 (Compiler-Explorer-Build-gcc-895dd027d5dda51a95d242aec8a49a6dfa5db58d-binut= ils-2.38) version 13.0.0 20221007 (experimental) (x86_64-linux-gnu) compiled by GNU C version 9.4.0, GMP version 6.2.1, MPFR version 4.= 1.0, MPC version 1.2.1, isl version isl-0.24-GMP=