diff options
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r-- | libcpp/line-map.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 742af0a07bb..07e3acb78a5 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -2128,6 +2128,12 @@ rich_location::add_fixit_insert_before (source_location where, if (reject_impossible_fixit (start)) return; + /* We do not yet support newlines within fix-it hints. */ + if (strchr (new_content, '\n')) + { + stop_supporting_fixits (); + return; + } add_fixit (new fixit_insert (start, new_content)); } @@ -2271,6 +2277,13 @@ rich_location::add_fixit_replace (source_range src_range, if (reject_impossible_fixit (src_range.m_finish)) return; + /* We do not yet support newlines within fix-it hints. */ + if (strchr (new_content, '\n')) + { + stop_supporting_fixits (); + return; + } + /* Consolidate neighboring fixits. */ fixit_hint *prev = get_last_fixit_hint (); if (prev) |