From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22187 invoked by alias); 3 Feb 2015 10:35:46 -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 22081 invoked by uid 48); 3 Feb 2015 10:35:42 -0000 From: "dodji at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55252] Caret diagnostic doesn't show useful location when macro clashes with name in system header Date: Tue, 03 Feb 2015 10:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji 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: --- 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: 2015-02/txt/msg00199.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55252 --- Comment #19 from Dodji Seketeli --- (In reply to Tom Tromey from comment #16) > I've tripped across this enough that I've actually filed dups twice now. > > I think it would be best to change the ordering here. > That is, the initial error ought to generally be the > location of the outermost expansion. Then, the remaining > notes ought to delineate the macro expansions. > > While it is true that this will yield a sub-optimal result in some > cases, I think that it will have better results in the preponderance > of cases. That is, there's no way to be perfect here but gcc could be more > useful. I am starting to think the same here. In the unwinding, it seems less surprising to start from the code the user has the most chance to have written herself, that is, the code at the point of expansion of the outermost macro, rather than the point where the offending token was spelled -- which can be hidden anywhere. If everyone agrees, then I am okay to change the unwinding direction for the next stage 1. Manuel, Jonathan, what do you think?