diff options
author | Aaron Puchert <aaron.puchert@sap.com> | 2019-05-31 21:27:39 +0000 |
---|---|---|
committer | Aaron Puchert <aaron.puchert@sap.com> | 2019-05-31 21:27:39 +0000 |
commit | 30a58f63af49d338960ff4f6a7f9d2238f527c9f (patch) | |
tree | d4376a211ab8c9b800ddbc1a7f1adadb905d43c9 /clang/docs | |
parent | 103bd108a71ccf40434b678534c837cbfe43319e (diff) | |
download | bcm5719-llvm-30a58f63af49d338960ff4f6a7f9d2238f527c9f.tar.gz bcm5719-llvm-30a58f63af49d338960ff4f6a7f9d2238f527c9f.zip |
Clarify when fix-it hints on warnings are appropriate
Summary:
This is not a change in the rules, it's meant as a clarification about
warnings. Since the recovery from warnings is a no-op, the fix-it hints
on warnings shouldn't change anything. Anything that doesn't just
suppress the warning and changes the meaning of the code (even if it's
for the better) should be on an additional note.
Reviewers: rsmith, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: cfe-commits, thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62470
llvm-svn: 362266
Diffstat (limited to 'clang/docs')
-rw-r--r-- | clang/docs/InternalsManual.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst index 7779310ee49..e1b5bd7c78f 100644 --- a/clang/docs/InternalsManual.rst +++ b/clang/docs/InternalsManual.rst @@ -423,6 +423,9 @@ Fix-it hints on errors and warnings need to obey these rules: driver, they should only be used when it's very likely they match the user's intent. * Clang must recover from errors as if the fix-it had been applied. +* Fix-it hints on a warning must not change the meaning of the code. + However, a hint may clarify the meaning as intentional, for example by adding + parentheses when the precedence of operators isn't obvious. If a fix-it can't obey these rules, put the fix-it on a note. Fix-its on notes are not applied automatically. |