public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66957] New: irregular "is protected within this context" error
@ 2015-07-21 15:24 dreamcooled at gmail dot com
  2015-07-21 17:23 ` [Bug c++/66957] [4.9/5/6 Regression] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dreamcooled at gmail dot com @ 2015-07-21 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66957
           Summary: irregular "is protected within this context" error
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dreamcooled at gmail dot com
  Target Milestone: ---

Created attachment 36023
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36023&action=edit
The code which produces the bug

In the attachment you find code which I'm trying to compile with g++.

I have a archlinux system and I have g++ version 5.1.0 from the offical repo of
my system.

I'm trying to compile the attached code by invoking 
`g++ classtest.cpp`. 

gcc fires the error:
classtest.cpp: In constructor ‘DerivedB::DerivedB()’:
classtest.cpp:9:5: error: ‘int BaseClass::x’ is protected
 int BaseClass::x;
     ^
classtest.cpp:22:32: error: within this context
         std::cout << DerivedA::x;
                                ^
What I'm trying to achieve is completely legal according to the c++ standard
([class.access.base]/p5 ).

More information, discussion, and a lot of people who agree that this is indeed
a gcc bug, can be found in the associated stackoverflow question:
http://stackoverflow.com/questions/31389470/g-compilation-error-is-protected-from-within-this-context-while-clang-do
>From gcc-bugs-return-492930-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 21 15:35:25 2015
Return-Path: <gcc-bugs-return-492930-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 119272 invoked by alias); 21 Jul 2015 15:35:25 -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 119190 invoked by uid 55); 21 Jul 2015 15:35:21 -0000
From: "aldyh at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/66468] [6 Regression] ICE in in check_die, at dwarf2out.c:5719
Date: Tue, 21 Jul 2015 15:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: aldyh at redhat dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: aldyh at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66468-4-wQMKlVRGI0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66468-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66468-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: 2015-07/txt/msg01820.txt.bz2
Content-length: 939

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf468

--- Comment #9 from Aldy Hernandez <aldyh at redhat dot com> ---
On 07/20/2015 03:14 PM, jason at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?idf468
>
> --- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
> The problem seems to be that we inlined the function, but DECL_POSSIBLY_INLINED
> remains unset, so dwarf2out doesn't think it needs to call
> dwarf2out_abstract_function.
>
> There also doesn't seem to be a cgraph edge for the inlined function call; I'm
> guessing that the function was inlined in the initial compilation, and this
> relationship is forgotten by the time we get to LTO.
>
> So, doesn't look like a dwarf2out bug.
>

Jason, thanks for looking into this.  Sorry it wasn't dwarf2out related.

Do you think perhaps we could diagnose this sort of problem earlier so
it doesn't show up (confusingly) in dwarf2out land?

Thanks.


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

end of thread, other threads:[~2015-08-22 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-21 15:24 [Bug c++/66957] New: irregular "is protected within this context" error dreamcooled at gmail dot com
2015-07-21 17:23 ` [Bug c++/66957] [4.9/5/6 Regression] " redi at gcc dot gnu.org
2015-08-17 21:33 ` [Bug c++/66957] [4.9/5/6 Regression] incorrect " jason at gcc dot gnu.org
2015-08-18 14:44 ` jason at gcc dot gnu.org
2015-08-18 14:44 ` jason at gcc dot gnu.org
2015-08-20  2:06 ` jason at gcc dot gnu.org
2015-08-21 11:08 ` ville.voutilainen at gmail dot com
2015-08-22 15:37 ` Casey at Carter dot net

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