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

Unified Diff: tools/clang/plugins/tests/missing_ctor.h

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 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 | « tools/clang/plugins/tests/base_refcounted.txt ('k') | tools/clang/plugins/tests/missing_ctor.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/plugins/tests/missing_ctor.h
diff --git a/tools/clang/plugins/tests/missing_ctor.h b/tools/clang/plugins/tests/missing_ctor.h
index 1050457a1a2e4d2533b7b33858dfd8789701c8d5..0551fd739473d6f0503185efd665d5bbeeecbbea 100644
--- a/tools/clang/plugins/tests/missing_ctor.h
+++ b/tools/clang/plugins/tests/missing_ctor.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+// Note: this should warn for an implicit copy constructor too, but currently
+// doesn't, due to a plugin bug.
class MissingCtorsArentOKInHeader {
public:
@@ -16,4 +18,33 @@ class MissingCtorsArentOKInHeader {
std::vector<std::string> two_;
};
+// Inline move ctors shouldn't be warned about. Similar to the previous test
+// case, this also incorrectly fails to warn for the implicit copy ctor.
+class InlineImplicitMoveCtorOK {
+ public:
+ InlineImplicitMoveCtorOK();
+
+ private:
+ // ctor weight = 12, dtor weight = 9.
+ std::string one_;
+ std::string two_;
+ std::string three_;
+ int four_;
+ int five_;
+ int six_;
+};
+
+class ExplicitlyDefaultedInlineAlsoWarns {
+ public:
+ ExplicitlyDefaultedInlineAlsoWarns() = default;
+ ~ExplicitlyDefaultedInlineAlsoWarns() = default;
+ ExplicitlyDefaultedInlineAlsoWarns(
+ const ExplicitlyDefaultedInlineAlsoWarns&) = default;
+
+ private:
+ std::vector<int> one_;
+ std::vector<std::string> two_;
+
+};
+
#endif // MISSING_CTOR_H_
« no previous file with comments | « tools/clang/plugins/tests/base_refcounted.txt ('k') | tools/clang/plugins/tests/missing_ctor.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698