From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20516 invoked by alias); 15 Jan 2014 00:37:12 -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 20472 invoked by uid 48); 15 Jan 2014 00:37:07 -0000 From: "libremax90 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template. Date: Wed, 15 Jan 2014 00:37: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: libremax90 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 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-01/txt/msg01514.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59816 Bug ID: 59816 Summary: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template. Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: libremax90 at gmail dot com The following C++11 code won't compile on GCC 4.8.2 while clang++ will accept it without a warning. In the following test case, GCC seems to check Base's default constructor visibility in the test function's context, where the templates are instantiated. class Base { protected: template Base(TArgs...) {} // Uncomment to workaround //Base() {} }; class Class : public Base { public: template Class(TArgs... args) : Base { args... } {} // Another workaround: //Class() {} }; void test() { Class{}; } Here is `g++ -v`'s output: Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /build/gcc/src/gcc-4.8-20131219/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib --disable-werror --enable-checking=release Thread model: posix gcc version 4.8.2 20131219 (prerelease) (GCC)