From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8347 invoked by alias); 20 Dec 2014 13:31:24 -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 8321 invoked by uid 48); 20 Dec 2014 13:31:19 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64367] [5 Regression] g++-v5/stdexcept:52:28: error: invalid use of non-static data member '_M_p' Date: Sat, 20 Dec 2014 13:31: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: trippels at gcc dot gnu.org 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: Message-ID: In-Reply-To: References: 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-12/txt/msg02450.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64367 --- Comment #2 from Markus Trippelsdorf --- It doesn't accept your example for C++98, too. C++11 is fine. markus@x4 ~ % cat test.ii union u { const char *_M_p; char _M_bytes[sizeof (_M_p)]; }; markus@x4 ~ % clang++ -std=c++11 -O2 -c test.ii markus@x4 ~ % clang++ -O2 -c test.ii test.ii:4:25: error: invalid use of non-static data member '_M_p' char _M_bytes[sizeof (_M_p)]; ^~~~ 1 error generated. markus@x4 ~ % This looks correct to me.