From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18926 invoked by alias); 4 Jan 2004 03:18:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18912 invoked by uid 48); 4 Jan 2004 03:18:54 -0000 Date: Sun, 04 Jan 2004 03:18:00 -0000 From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040104031849.13560.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13560] New: wrong file name in error message X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg00284.txt.bz2 List-Id: Compile the following and you will get: test.h: In function `int main()': test.h:3: error: `int t::g' is private test.cc:7: error: within this context See how it says main is in test.h, this is wrong. The problem is in cp_error_at set the location information but since the "In function ..." has not been printed yet for this function so it prints with the location information which cp_error_at sets which is wrong, one way to fix this is to add a new location_t to diagnostic_info to store the old one for printing out the "In function ..." message. ----- preprocessed source ----- # 1 "" # 1 "" # 1 "test.cc" # 1 "test.h" 1 class t { int g; }; void h(t&); # 2 "test.cc" 2 int main() { t y; h(y); return y.g; } -- Summary: wrong file name in error message Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: gdr at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: carlo at alinoe dot com,gcc-bugs at gcc dot gnu dot org,igodard at pacbell dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13560