From 53290e072ae4d8e5d61f82d651b6fba309fed6f1 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 8 Jan 2016 07:43:31 +0100 Subject: =?UTF-8?q?re=20PR=20c++/69145=20(Bogus=20'warning:=20#pragma=20im?= =?UTF-8?q?plementation=20for=20=E2=80=98...=E2=80=99=20appears=20after=20?= =?UTF-8?q?file=20is=20included')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR c++/69145 * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup real location from the line_table. * g++.dg/ext/pr69145-1.C: New test. * g++.dg/ext/pr69145-2-very-long-filename.cc: New file. * g++.dg/ext/pr69145-2.h: New file. From-SVN: r232150 --- libcpp/files.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libcpp/files.c') diff --git a/libcpp/files.c b/libcpp/files.c index 1952774..22b1d05 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -1224,10 +1224,12 @@ bool cpp_included_before (cpp_reader *pfile, const char *fname, source_location location) { - struct cpp_file_hash_entry *entry; + struct cpp_file_hash_entry *entry + = (struct cpp_file_hash_entry *) + htab_find_with_hash (pfile->file_hash, fname, htab_hash_string (fname)); - entry = (struct cpp_file_hash_entry *) - htab_find_with_hash (pfile->file_hash, fname, htab_hash_string (fname)); + if (IS_ADHOC_LOC (location)) + location = get_location_from_adhoc_loc (pfile->line_table, location); while (entry && (entry->start_dir == NULL || entry->u.file->err_no || entry->location > location)) -- cgit v1.1