libcpp uses diagnostic->override_column to give a custom column number to diagnostics.
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Tue, 2 Dec 2014 23:16:21 +0000 (23:16 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Tue, 2 Dec 2014 23:16:21 +0000 (23:16 +0000)
libcpp uses diagnostic->override_column to give a custom column number to
diagnostics. This is taken into account when building the prefix, but it was
missing when placing the caret.

2014-12-03  Manuel López-Ibáñez  <manu@gcc.gnu.org>

* diagnostic.c (diagnostic_show_locus): Honor override_column when
placing the caret.

From-SVN: r218295

gcc/ChangeLog
gcc/diagnostic.c

index b2eb9506485881ce35f3bf36f7f8ff85e45dbc36..ceb9e108a9f58be5a6ebdf08fb600ce938c1cc5e 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-03  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * diagnostic.c (diagnostic_show_locus): Honor override_column when
+       placing the caret.
+
 2014-12-02  Dmitry Vyukov  <dvyukov@google.com>
 
        * asan.c: (asan_finish_file): Use default priority for constructors
index f7f8aaa23c07d5f604248aaf329f5aa47e4d4ebc..0c8fbe5f766cfdc468c7143c8ca6020a66d568b8 100644 (file)
@@ -310,6 +310,8 @@ diagnostic_show_locus (diagnostic_context * context,
 
   context->last_location = diagnostic->location;
   s = expand_location_to_spelling_point (diagnostic->location);
+  if (diagnostic->override_column)
+    s.column = diagnostic->override_column;
   line = location_get_source_line (s, &line_width);
   if (line == NULL || s.column > line_width)
     return;