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

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

Issue 1137973002: clang/win plugin: Do not warn on dllexport inline move constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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
« no previous file with comments | « no previous file | tools/clang/plugins/tests/missing_ctor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/plugins/FindBadConstructsConsumer.cpp
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
index 2b8719326714a0ea24508c8ee24a24f35ccb8865..83a18b0206f7d1ac6371a5fead21a7ba05f91aa9 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
+++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
@@ -306,8 +306,15 @@ void FindBadConstructsConsumer::CheckCtorDtorWeight(
"Complex class/struct needs an explicit out-of-line "
"copy constructor.");
} else {
- emitWarning(it->getInnerLocStart(),
- "Complex constructor has an inlined body.");
+ // See the comment in the previous branch about copy constructors.
+ // This does the same for implicit move constructors.
+ bool is_likely_compiler_generated_dllexport_move_ctor =
+ it->isMoveConstructor() &&
+ !record->hasUserDeclaredMoveConstructor() &&
+ record->hasAttr<DLLExportAttr>();
+ if (!is_likely_compiler_generated_dllexport_move_ctor)
+ emitWarning(it->getInnerLocStart(),
+ "Complex constructor has an inlined body.");
}
} else if (it->isInlined() && !it->isInlineSpecified() &&
!it->isDeleted() && (!it->isCopyOrMoveConstructor() ||
« no previous file with comments | « no previous file | tools/clang/plugins/tests/missing_ctor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698