public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template.
@ 2014-01-15  0:37 libremax90 at gmail dot com
  2014-01-16 21:41 ` [Bug c++/59816] " daniel.kruegler at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: libremax90 at gmail dot com @ 2014-01-15  0:37 UTC (permalink / raw)
  To: gcc-bugs

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<class... TArgs>
  Base(TArgs...) {}

  // Uncomment to workaround                                                    
  //Base() {}                                                                   
};

class Class
  : public Base {
public:
  template<class... TArgs>
  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)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/59816] [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template.
  2014-01-15  0:37 [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template libremax90 at gmail dot com
@ 2014-01-16 21:41 ` daniel.kruegler at googlemail dot com
  2015-03-18 20:55 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-01-16 21:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59816

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The problem still exists in 4.9.0 20140110 (experimental)
>From gcc-bugs-return-440640-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 21:52:45 2014
Return-Path: <gcc-bugs-return-440640-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18517 invoked by alias); 16 Jan 2014 21:52:45 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18487 invoked by uid 48); 16 Jan 2014 21:52:41 -0000
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59121] [4.8/4.9 Regression] endless loop with -O2 -floop-parallelize-all
Date: Thu, 16 Jan 2014 21:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: compile-time-hog
X-Bugzilla-Severity: normal
X-Bugzilla-Who: law at redhat dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: priority cc
Message-ID: <bug-59121-4-bd6K1hjUFm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59121-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59121-4@http.gcc.gnu.org/bugzilla/>
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/msg01782.txt.bz2
Content-length: 522

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY121

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4
                 CC|                            |law at redhat dot com

--- Comment #10 from Jeffrey A. Law <law at redhat dot com> ---
IMHO, it's high time we move graphite to an unsupported state and closed all
related PRs as WONTFIX.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/59816] [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template.
  2014-01-15  0:37 [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template libremax90 at gmail dot com
  2014-01-16 21:41 ` [Bug c++/59816] " daniel.kruegler at googlemail dot com
@ 2015-03-18 20:55 ` paolo.carlini at oracle dot com
  2015-03-18 21:30 ` paolo at gcc dot gnu.org
  2015-03-18 21:31 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-18 20:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59816

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is fixed for 5.0. I'm adding the testcase and closing the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/59816] [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template.
  2014-01-15  0:37 [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template libremax90 at gmail dot com
  2014-01-16 21:41 ` [Bug c++/59816] " daniel.kruegler at googlemail dot com
  2015-03-18 20:55 ` paolo.carlini at oracle dot com
@ 2015-03-18 21:30 ` paolo at gcc dot gnu.org
  2015-03-18 21:31 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-03-18 21:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59816

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Mar 18 21:30:04 2015
New Revision: 221502

URL: https://gcc.gnu.org/viewcvs?rev=221502&root=gcc&view=rev
Log:
2015-03-18  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59816
    * g++.dg/cpp0x/pr59816.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr59816.C
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/59816] [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template.
  2014-01-15  0:37 [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template libremax90 at gmail dot com
                   ` (2 preceding siblings ...)
  2015-03-18 21:30 ` paolo at gcc dot gnu.org
@ 2015-03-18 21:31 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-18 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59816

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-18 21:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15  0:37 [Bug c++/59816] New: [c++11] Incorrect visibility check in template instantiation when the default constructor is a variadic template libremax90 at gmail dot com
2014-01-16 21:41 ` [Bug c++/59816] " daniel.kruegler at googlemail dot com
2015-03-18 20:55 ` paolo.carlini at oracle dot com
2015-03-18 21:30 ` paolo at gcc dot gnu.org
2015-03-18 21:31 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).