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

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

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.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 | « tools/clang/plugins/SuppressibleDiagnosticBuilder.h ('k') | tools/clang/plugins/tests/missing_ctor.cpp » ('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 0551fd739473d6f0503185efd665d5bbeeecbbea..2587a10d9e75dd80b018d4ef771ca4ca4c82a92e 100644
--- a/tools/clang/plugins/tests/missing_ctor.h
+++ b/tools/clang/plugins/tests/missing_ctor.h
@@ -5,8 +5,20 @@
#ifndef MISSING_CTOR_H_
#define MISSING_CTOR_H_
-#include <string>
-#include <vector>
+struct MyString {
+ MyString();
+ ~MyString();
+ MyString(const MyString&);
+ MyString(MyString&&);
+};
+
+template <class T>
+struct MyVector {
+ MyVector();
+ ~MyVector();
+ MyVector(const MyVector&);
+ MyVector(MyVector&&);
+};
// Note: this should warn for an implicit copy constructor too, but currently
// doesn't, due to a plugin bug.
@@ -14,8 +26,8 @@ class MissingCtorsArentOKInHeader {
public:
private:
- std::vector<int> one_;
- std::vector<std::string> two_;
+ MyVector<int> one_;
+ MyVector<MyString> two_;
};
// Inline move ctors shouldn't be warned about. Similar to the previous test
@@ -26,9 +38,9 @@ class InlineImplicitMoveCtorOK {
private:
// ctor weight = 12, dtor weight = 9.
- std::string one_;
- std::string two_;
- std::string three_;
+ MyString one_;
+ MyString two_;
+ MyString three_;
int four_;
int five_;
int six_;
@@ -42,8 +54,8 @@ class ExplicitlyDefaultedInlineAlsoWarns {
const ExplicitlyDefaultedInlineAlsoWarns&) = default;
private:
- std::vector<int> one_;
- std::vector<std::string> two_;
+ MyVector<int> one_;
+ MyVector<MyString> two_;
};
« no previous file with comments | « tools/clang/plugins/SuppressibleDiagnosticBuilder.h ('k') | tools/clang/plugins/tests/missing_ctor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698