From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30585 invoked by alias); 14 Nov 2013 15:47:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30507 invoked by uid 48); 14 Nov 2013 15:47:04 -0000 From: "vexocide at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59135] New: Incorrect ambiguity in constexpr function overloads Date: Thu, 14 Nov 2013 15:47:00 -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: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vexocide at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg01393.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59135 Bug ID: 59135 Summary: Incorrect ambiguity in constexpr function overloads Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vexocide at gmail dot com Created attachment 31220 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31220&action=edit minimal example Using built-in specs. COLLECT_GCC=g++-mp-4.8 COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin13/4.8.2/lto-wrapper Target: x86_64-apple-darwin13 Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc48/gcc48/work/gcc-4.8.2/configure --prefix=/opt/local --build=x86_64-apple-darwin13 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc48 --includedir=/opt/local/include/gcc48 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.8 --with-gxx-include-dir=/opt/local/include/gcc48/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc48 4.8.2_0' Thread model: posix gcc version 4.8.2 (MacPorts gcc48 4.8.2_0) g++-mp-4.8 test.cpp -o test -std=c++11 -Wall -Wextra -Wno-unused-parameter 0 s050414t 16:39 test.cpp: In function 'int main(int, char**)': test.cpp:22:28: error: call of overloaded 'bar(foo, int, int)' is ambiguous bar<0>(foo(), 1, 2); ^ test.cpp:22:28: note: candidates are: test.cpp:9:16: note: constexpr bool bar(T&&, Us&& ...) [with long unsigned int N = 0ul; T = foo; Us = {int, int}] constexpr bool bar(T && t, Us &&... us) ^ test.cpp:15:16: note: constexpr bool bar(foo&&, Us&& ...) [with long unsigned int N = 0ul; T = int; Us = {int, int}] constexpr bool bar(foo && t, Us &&... us) ^ clang++-mp-3.4 test.cpp -o test -std=c++11 -Wall -Wextra -Wno-unused-parameter compiles the example as expected.