diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 20:58:11 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-28 20:58:11 +0000 |
commit | 7228f89d0949bd948fb0ea57d1d505641d3420f4 (patch) | |
tree | be6b9f3b266430033eb656f2a6025d88bcede094 | |
parent | 7d21a04e49c86f192148a9a6461138f409906858 (diff) | |
download | chromium_src-7228f89d0949bd948fb0ea57d1d505641d3420f4.zip chromium_src-7228f89d0949bd948fb0ea57d1d505641d3420f4.tar.gz chromium_src-7228f89d0949bd948fb0ea57d1d505641d3420f4.tar.bz2 |
clang: Mention that the ctor/dtor needs "out of line" implementation.
BUG=78743
TEST=None
R=erg@chromium.org,thakis@chromium.org
Review URL: http://codereview.chromium.org/6901095
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83397 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | tools/clang/plugins/FindBadConstructs.cpp | 9 | ||||
-rw-r--r-- | tools/clang/plugins/tests/missing_ctor.txt | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tools/clang/plugins/FindBadConstructs.cpp b/tools/clang/plugins/FindBadConstructs.cpp index d7bcdae..4c3c8ef 100644 --- a/tools/clang/plugins/FindBadConstructs.cpp +++ b/tools/clang/plugins/FindBadConstructs.cpp @@ -104,7 +104,8 @@ class FindBadConstructsConsumer : public ChromeClassTester { if (ctor_score >= 10) { if (!record->hasUserDeclaredConstructor()) { emitWarning(record_location, - "Complex class/struct needs a declared constructor."); + "Complex class/struct needs an explicit out-of-line " + "constructor."); } else { // Iterate across all the constructors in this file and yell if we // find one that tries to be inline. @@ -122,8 +123,10 @@ class FindBadConstructsConsumer : public ChromeClassTester { // trivial members; 20 ints don't need a destructor. if (dtor_score >= 10 && !record->hasTrivialDestructor()) { if (!record->hasUserDeclaredDestructor()) { - emitWarning(record_location, - "Complex class/struct needs a declared destructor."); + emitWarning( + record_location, + "Complex class/struct needs a needs an explicit out-of-line " + "destructor."); } else if (CXXDestructorDecl* dtor = record->getDestructor()) { if (dtor->hasInlineBody()) { emitWarning(dtor->getInnerLocStart(), diff --git a/tools/clang/plugins/tests/missing_ctor.txt b/tools/clang/plugins/tests/missing_ctor.txt index d22f03f..301449c 100644 --- a/tools/clang/plugins/tests/missing_ctor.txt +++ b/tools/clang/plugins/tests/missing_ctor.txt @@ -1,6 +1,6 @@ In file included from missing_ctor.cpp:5: -./missing_ctor.h:11:1: warning: [chromium-style] Complex class/struct needs a declared constructor. +./missing_ctor.h:11:1: warning: [chromium-style] Complex class/struct needs an explicit out-of-line constructor. class MissingCtorsArentOKInHeader { ^ -./missing_ctor.h:11:1: warning: [chromium-style] Complex class/struct needs a declared destructor. +./missing_ctor.h:11:1: warning: [chromium-style] Complex class/struct needs an explicit out-of-line destructor. 2 warnings generated. |