summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-08 06:43:31 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-08 06:43:31 +0000
commit5d034e3773c109929a1f6929f515b6b7164b088a (patch)
tree9c330c06778ecd0226eeabc96443afbdd75b67e2 /libcpp
parent3189b981f2677e6100d8da78c4d7078696643b78 (diff)
downloadgcc-5d034e3773c109929a1f6929f515b6b7164b088a.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/files.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 1151ad2180b..7845795b840 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/69145
+ * files.c (cpp_included_before): If IS_ADHOC_LOC (location), lookup
+ real location from the line_table.
+
2016-01-04 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/libcpp/files.c b/libcpp/files.c
index 19527749d64..22b1d05b223 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))