http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60399 Daniel Krügler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #1 from Daniel Krügler --- No, the compiler is conforming: According to 7.1.6 p6: "If the instantiated template specialization of a constexpr [..] member function of a class template would fail to satisfy the requirements for a constexpr function or constexpr constructor, that specialization is still a constexpr function or constexpr constructor, even though a call to such a function cannot appear in a constant expression." So, per se, the situation is well-defined here and there is fundamentally nothing wrong with the constructor, because your code does not attempt to use it in a constant expression. What makes your code ill-formed is the fact that your template could never be instantiated to make the constructor a constexpr constructor, see the following sentence: "If no specialization of the template would satisfy the requirements for a constexpr function or constexpr constructor when considered as a non-template function or constructor, the template is ill-formed; no diagnostic required." As you may notice, this kind of code does not require a diagnostics. >From gcc-bugs-return-445329-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 03 19:30:36 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 3527 invoked by alias); 3 Mar 2014 19:30:35 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 3088 invoked by uid 48); 3 Mar 2014 19:30:28 -0000 From: "fredrik at lysator dot liu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified Date: Mon, 03 Mar 2014 19:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fredrik at lysator dot liu.se 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: cc 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-SW-Source: 2014-03/txt/msg00198.txt.bz2 Content-length: 1640 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58638 Fredrik Nyström changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fredrik at lysator dot liu.se --- Comment #3 from Fredrik Nyström --- Seems to be a bug in libstdc++-v3/configure, same in both gcc-4.8 and gcc-4.9. Suggested fix: --- libstdc++-v3/configure~ 2013-11-22 14:17:55.000000000 +0100 +++ libstdc++-v3/configure 2014-03-03 20:01:32.000000000 +0100 @@ -14909,25 +14909,25 @@ # libtool variables for C++ shared and position-independent compiles. # # Use glibcxx_lt_pic_flag to designate the automake variable # used to encapsulate the default libtool approach to creating objects # with position-independent code. Default: -prefer-pic. # # Use glibcxx_compiler_shared_flag to designate a compile-time flags for # creating shared objects. Default: -D_GLIBCXX_SHARED. # # Use glibcxx_compiler_pic_flag to designate a compile-time flags for # creating position-independent objects. This varies with the target # hardware and operating system, but is often: -DPIC -fPIC. -if test "$enable_shared" = yes; then +if test "$enable_shared" = yes || test "${with_pic+set}" = set; then glibcxx_lt_pic_flag="-prefer-pic" glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX" glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED" else glibcxx_lt_pic_flag= glibcxx_compiler_pic_flag= glibcxx_compiler_shared_flag= fi >From gcc-bugs-return-445330-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 03 19:31:33 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 4410 invoked by alias); 3 Mar 2014 19:31:33 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 4380 invoked by uid 48); 3 Mar 2014 19:31:30 -0000 From: "nate.mcnamara at morganstanley dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60402] New: const overload with variadics declared ambiguous according to standard (may be related to bug 58156) Date: Mon, 03 Mar 2014 19:31: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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nate.mcnamara at morganstanley 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: 2014-03/txt/msg00199.txt.bz2 Content-length: 2327 http://gcc.gnu.org/bugzilla/show_bug.cgi?id`402 Bug ID: 60402 Summary: const overload with variadics declared ambiguous according to standard (may be related to bug 58156) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nate.mcnamara at morganstanley dot com Created attachment 32255 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id2255&actioníit preprocessed source $ g++ -v Reading specs from /ms/dist/fsf/PROJ/gcc/4.8.1/.exec/@sys/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/specs COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/ms/dist/fsf/PROJ/gcc/4.8.1/.exec/@sys/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: //ms/dev/fsf/gcc/4.8.1/src/gcc-4.8.1/configure --prefix=//ms/dist/fsf/PROJ/gcc/4.8.1/.exec/x86_64.linux.2.6.glibc.2.3 --exec-prefix=//ms/dist/fsf/PROJ/gcc/4.8.1/.exec/x86_64.linux.2.6.glibc.2.3 --disable-checking --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,fortran --with-gmp=//ms/dev/fsf/gcc/4.8.1/install/.exec/x86_64.linux.2.6.glibc.2.3 --with-mpfr=//ms/dev/fsf/gcc/4.8.1/install/.exec/x86_64.linux.2.6.glibc.2.3 --with-mpc=//ms/dev/fsf/gcc/4.8.1/install/.exec/x86_64.linux.2.6.glibc.2.3 --enable-linker-build-id --with-cloog=//ms/dev/fsf/gcc/4.8.1/install/.exec/x86_64.linux.2.6.glibc.2.3 --with-isl=//ms/dev/fsf/gcc/4.8.1/install/.exec/x86_64.linux.2.6.glibc.2.3 --with-gnu-as --with-gnu-ld Thread model: posix gcc version 4.8.1 (GCC) $ g++ -std=c++11 ambiguous.cpp ambiguous.cpp: In instantiation of 'void f(const char*, T ...) [with T {int}]': ambiguous.cpp:12:14: required from here ambiguous.cpp:7:51: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default] f(const_cast(s), std::forward(args)...); ^ ambiguous.cpp:6:6: note: candidate 1: void f(const char*, T ...) [with T {int}] void f(const char* s, T... args) { ^ ambiguous.cpp:3:6: note: candidate 2: void f(char*, ...) void f(char* s, ...) {} ^