public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58896] New: Incorrect handling of a private nested type of a template specialization in the main template
@ 2013-10-27 17:54 ville.voutilainen at gmail dot com
  2013-11-05 12:00 ` [Bug c++/58896] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ville.voutilainen at gmail dot com @ 2013-10-27 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58896
           Summary: Incorrect handling of a private nested type of a
                    template specialization in the main template
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

This code compiles without any problem:

template<typename> class Obj; 
template<> class Obj<void> { 
  struct secret{}; 
}; 
template<typename T> class Obj { 
  Obj<void>::secret m; 
};

int main()
{ 
  Obj<int> obj; 
}

It's as if the main template somehow manages to be a friend of its
specialization. When the nested name is a typedef, it's diagnosed:

template<typename> class Obj; 
template<> class Obj<void> { 
  typedef int secret; 
}; 
template<typename T> class Obj { 
  Obj<void>::secret m; 
};

int main()
{ 
  Obj<int> obj; 
}

This results in

edoceo.cpp: In instantiation of ‘class Obj<int>’:
edoceo.cpp:11:12:   required from here
edoceo.cpp:3:15: error: ‘typedef int Obj<void>::secret’ is private
   typedef int secret; 
               ^
edoceo.cpp:6:14: error: within this context
   Obj<void>::secret m; 
              ^
>From gcc-bugs-return-432840-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 27 19:53:04 2013
Return-Path: <gcc-bugs-return-432840-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5964 invoked by alias); 27 Oct 2013 19:53:03 -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 5803 invoked by uid 48); 27 Oct 2013 19:53:00 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sun, 27 Oct 2013 19:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58679-4-BIdzZrUVu0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
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: 2013-10/txt/msg01984.txt.bz2
Content-length: 448

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mustrumr97 at gmail dot com

--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> ---
*** Bug 58792 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-432839-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 27 19:53:03 2013
Return-Path: <gcc-bugs-return-432839-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5930 invoked by alias); 27 Oct 2013 19:53:02 -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 5778 invoked by uid 48); 27 Oct 2013 19:52:59 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58792] [4.9 Regression] ICE at mode-switching.c:421 when compiling clang lib/AST/MicrosoftCXXABI.cpp
Date: Sun, 27 Oct 2013 19:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-58792-4-vFdKtA2u1d@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58792-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58792-4@http.gcc.gnu.org/bugzilla/>
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: 2013-10/txt/msg01983.txt.bz2
Content-length: 972

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #9)

> > libstdc++-v3/libsupc++/eh_terminate.cc: In function ‘void (*
> > std::set_terminate(std::terminate_handler))()’:
> > libstdc++-v3/libsupc++/eh_terminate.cc:85:1: internal compiler error: in
> > create_pre_exit, at mode-switching.c:422
> 
> If this is with today's compiler, then this is PR58679.

Fixed by revert [1] and actually a duplicate of PR58679.

[1]http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02237.html

*** This bug has been marked as a duplicate of bug 58679 ***
>From gcc-bugs-return-432841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 27 20:32:45 2013
Return-Path: <gcc-bugs-return-432841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29603 invoked by alias); 27 Oct 2013 20:32:43 -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 29519 invoked by uid 55); 27 Oct 2013 20:32:38 -0000
From: "uros at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sun, 27 Oct 2013 20:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: uros at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58679-4-WdqQqDwane@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-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: 2013-10/txt/msg01985.txt.bz2
Content-length: 497

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

--- Comment #14 from uros at gcc dot gnu.org ---
Author: uros
Date: Sun Oct 27 20:32:29 2013
New Revision: 204109

URL: http://gcc.gnu.org/viewcvs?rev 4109&root=gcc&view=rev
Log:
    PR target/58679
    * gcc.target/i386/pr58679-1.c: New test.
    * gcc.target/i386/pr58679-2.c: Ditto.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr58679-1.c
    trunk/gcc/testsuite/gcc.target/i386/pr58679-2.c
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58896] Incorrect handling of a private nested type of a template specialization in the main template
  2013-10-27 17:54 [Bug c++/58896] New: Incorrect handling of a private nested type of a template specialization in the main template ville.voutilainen at gmail dot com
@ 2013-11-05 12:00 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-05 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-05
             Blocks|                            |59002
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
G++ has a lot of bugs with access checking in templates


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

end of thread, other threads:[~2013-11-05 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-27 17:54 [Bug c++/58896] New: Incorrect handling of a private nested type of a template specialization in the main template ville.voutilainen at gmail dot com
2013-11-05 12:00 ` [Bug c++/58896] " redi at gcc dot gnu.org

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).