Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: tools/clang/plugins/FindBadConstructsConsumer.cpp

Issue 2108823004: clang-plugins: Don't strip non const references in auto raw ptr fixits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/clang/plugins/FindBadConstructsConsumer.cpp
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
index af526ecb14622f1bcfc14f921fae74d0472548df..f670a3673ac2d9c05d1f76f690d4960b54b0dc55 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
+++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
@@ -124,6 +124,12 @@ std::string GetAutoReplacementTypeAsString(QualType type) {
result += " const";
if (non_reference_type.isLocalVolatileQualified())
result += " volatile";
+ if (type->isReferenceType() && !non_reference_type.isLocalConstQualified()) {
+ if (type->isLValueReferenceType())
+ result += "&";
+ else if (type->isRValueReferenceType())
+ result += "&&";
+ }
return result;
}
« no previous file with comments | « no previous file | tools/clang/plugins/tests/auto_raw_pointer.cpp » ('j') | tools/clang/plugins/tests/auto_raw_pointer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698