summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/test
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-19 09:00:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-19 11:34:15 +0200
commit45c06838e95c94445359536d84c6328fa8b17a66 (patch)
treeda05ccf67ce15d5afc78c2ddb80d117c0a576c84 /compilerplugins/clang/test
parentd3e0ab976a5bbf63d1673422035def67ba9f4838 (diff)
only unit-test one loplugin at a time
tell the plugin code when we are unit-testing it, so we can suppress all the warnings except for the plugin we are currently testing Change-Id: I240c8e37eba90c219e53c29531a3a43bc841a1c8
Diffstat (limited to 'compilerplugins/clang/test')
-rw-r--r--compilerplugins/clang/test/finalprotected.cxx12
-rw-r--r--compilerplugins/clang/test/passstuffbyref.cxx4
-rw-r--r--compilerplugins/clang/test/redundantinline.hxx2
-rw-r--r--compilerplugins/clang/test/stringconstant.cxx2
-rw-r--r--compilerplugins/clang/test/useuniqueptr.cxx2
-rw-r--r--compilerplugins/clang/test/vclwidgets.cxx8
6 files changed, 16 insertions, 14 deletions
diff --git a/compilerplugins/clang/test/finalprotected.cxx b/compilerplugins/clang/test/finalprotected.cxx
index 99fb19584a8d..c15564874447 100644
--- a/compilerplugins/clang/test/finalprotected.cxx
+++ b/compilerplugins/clang/test/finalprotected.cxx
@@ -10,25 +10,25 @@
class S final {
protected:
- void f(int f) { f1 = f; } // expected-error {{final class should not have protected members - convert them to private [loplugin:finalprotected]}} expected-error {{[loplugin:unreffun]}}
+ void f(int f) { f1 = f; } // expected-error {{final class should not have protected members - convert them to private [loplugin:finalprotected]}}
int f1; // expected-error {{final class should not have protected members - convert them to private [loplugin:finalprotected]}}
public:
- void g(); // expected-error {{[loplugin:externandnotdefined]}} expected-error {{[loplugin:unreffun]}}
+ void g();
int g1;
private:
- void h(); // expected-error {{[loplugin:externandnotdefined]}} expected-error {{[loplugin:unreffun]}}
+ void h();
int h1;
};
class S2 {
protected:
- void f(int f) { f1 = f; } // expected-error {{[loplugin:unreffun]}}
+ void f(int f) { f1 = f; }
int f1;
public:
- void g(); // expected-error {{[loplugin:externandnotdefined]}} expected-error {{[loplugin:unreffun]}}
+ void g();
int g1;
private:
- void h(); // expected-error {{[loplugin:externandnotdefined]}} expected-error {{[loplugin:unreffun]}}
+ void h();
int h1;
};
diff --git a/compilerplugins/clang/test/passstuffbyref.cxx b/compilerplugins/clang/test/passstuffbyref.cxx
index 7c31af77df77..89f51fb1c294 100644
--- a/compilerplugins/clang/test/passstuffbyref.cxx
+++ b/compilerplugins/clang/test/passstuffbyref.cxx
@@ -19,11 +19,13 @@ struct S {
};
-void f() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+void f()
{
S* s;
OUString v1, v2;
s = new S(v1, v2);
}
+// expected-no-diagnostics
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/compilerplugins/clang/test/redundantinline.hxx b/compilerplugins/clang/test/redundantinline.hxx
index a0c91ceb67be..e4efc5663e42 100644
--- a/compilerplugins/clang/test/redundantinline.hxx
+++ b/compilerplugins/clang/test/redundantinline.hxx
@@ -19,7 +19,7 @@ S1::S1() = default;
struct S2 {
inline S2() = default; // expected-error {{[loplugin:redundantinline]}}
- inline ~S2() = default; // expected-error {{[loplugin:redundantinline]}} expected-error {{[loplugin:unnecessaryoverride]}}
+ inline ~S2() = default; // expected-error {{[loplugin:redundantinline]}}
};
struct S3 {
diff --git a/compilerplugins/clang/test/stringconstant.cxx b/compilerplugins/clang/test/stringconstant.cxx
index 392567fa3cab..1b1eca2794bb 100644
--- a/compilerplugins/clang/test/stringconstant.cxx
+++ b/compilerplugins/clang/test/stringconstant.cxx
@@ -14,7 +14,7 @@
#include "com/sun/star/uno/Reference.hxx"
#include "rtl/strbuf.hxx"
-extern void foo(OUString const &); // expected-error {{extern prototype in main file without definition}}
+extern void foo(OUString const &);
struct Foo {
Foo(OUString const &, int) {}
diff --git a/compilerplugins/clang/test/useuniqueptr.cxx b/compilerplugins/clang/test/useuniqueptr.cxx
index c705bbf0f158..564e93ccbdc0 100644
--- a/compilerplugins/clang/test/useuniqueptr.cxx
+++ b/compilerplugins/clang/test/useuniqueptr.cxx
@@ -10,7 +10,7 @@
class Foo {
char* m_pbar; // expected-note {{member is here [loplugin:useuniqueptr]}}
- ~Foo() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+ ~Foo()
{
delete m_pbar; // expected-error {{a destructor with only a single unconditional call to delete on a member, is a sure sign it should be using std::unique_ptr for that field [loplugin:useuniqueptr]}}
m_pbar = nullptr;
diff --git a/compilerplugins/clang/test/vclwidgets.cxx b/compilerplugins/clang/test/vclwidgets.cxx
index d7926c0c4e98..9ead1c905289 100644
--- a/compilerplugins/clang/test/vclwidgets.cxx
+++ b/compilerplugins/clang/test/vclwidgets.cxx
@@ -16,7 +16,7 @@ struct Widget : public VclReferenceBase
{
VclPtr<Widget> mpParent;
- void widget1() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+ void widget1()
{
// test that we ignore assignments from a member field
Widget* p = mpParent;
@@ -48,7 +48,7 @@ Widget* g()
}
// test the variable init detection
-void bar() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+void bar()
{
Widget* p = f(); // expected-error {{assigning a returned-by-value VclPtr<T> to a T* variable is dodgy, should be assigned to a VclPtr. If you know that the RHS does not return a newly created T, then add a '.get()' to the RHS [loplugin:vclwidgets]}}
(void)p;
@@ -59,7 +59,7 @@ void bar() // expected-error {{Unreferenced externally visible function definiti
}
// test the assignment detection
-void bar2() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+void bar2()
{
Widget* p;
p = nullptr;
@@ -76,7 +76,7 @@ void bar2() // expected-error {{Unreferenced externally visible function definit
template<class T>
T * get() { return nullptr; }
-void bar3() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+void bar3()
{
Widget* p;
p = get<Widget>();