[clang-tools-extra] r225520 - clang-tidy: [misc-use-override] Simplify regular expressions in test.
Daniel Jasper
djasper at google.com
Fri Jan 9 06:10:15 PST 2015
Author: djasper
Date: Fri Jan 9 08:10:15 2015
New Revision: 225520
URL: http://llvm.org/viewvc/llvm-project?rev=225520&view=rev
Log:
clang-tidy: [misc-use-override] Simplify regular expressions in test.
No functional changes.
Modified:
clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp
Modified: clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp?rev=225520&r1=225519&r2=225520&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp Fri Jan 9 08:10:15 2015
@@ -36,136 +36,136 @@ struct SimpleCases : public Base {
public:
virtual ~SimpleCases();
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: Prefer using 'override' or (rarely) 'final' instead of 'virtual'
- // CHECK-FIXES: {{^ ~SimpleCases\(\) override;}}
+ // CHECK-FIXES: {{^}} ~SimpleCases() override;
void a();
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Annotate this
- // CHECK-FIXES: {{^ void a\(\) override;}}
+ // CHECK-FIXES: {{^}} void a() override;
void b() override;
// CHECK-MESSAGES-NOT: warning:
- // CHECK-FIXES: {{^ void b\(\) override;}}
+ // CHECK-FIXES: {{^}} void b() override;
virtual void c();
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void c\(\) override;}}
+ // CHECK-FIXES: {{^}} void c() override;
virtual void d() override;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void d\(\) override;}}
+ // CHECK-FIXES: {{^}} void d() override;
virtual void e() = 0;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void e\(\) override = 0;}}
+ // CHECK-FIXES: {{^}} void e() override = 0;
virtual void f()=0;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void f\(\)override =0;}}
+ // CHECK-FIXES: {{^}} void f()override =0;
virtual void g() ABSTRACT;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void g\(\) override ABSTRACT;}}
+ // CHECK-FIXES: {{^}} void g() override ABSTRACT;
virtual void j() const;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void j\(\) const override;}}
+ // CHECK-FIXES: {{^}} void j() const override;
virtual MustUseResultObject k(); // Has an implicit attribute.
// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: Prefer using
- // CHECK-FIXES: {{^ MustUseResultObject k\(\) override;}}
+ // CHECK-FIXES: {{^}} MustUseResultObject k() override;
virtual bool l() MUST_USE_RESULT UNUSED;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ bool l\(\) override MUST_USE_RESULT UNUSED;}}
+ // CHECK-FIXES: {{^}} bool l() override MUST_USE_RESULT UNUSED;
virtual bool n() UNUSED MUST_USE_RESULT;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ bool n\(\) override UNUSED MUST_USE_RESULT;}}
+ // CHECK-FIXES: {{^}} bool n() override UNUSED MUST_USE_RESULT;
virtual void m() override final;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void m\(\) final;}}
+ // CHECK-FIXES: {{^}} void m() final;
virtual void o() __attribute__((unused));
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void o\(\) override __attribute__\(\(unused\)\);}}
+ // CHECK-FIXES: {{^}} void o() override __attribute__((unused));
};
// CHECK-MESSAGES-NOT: warning:
void SimpleCases::c() {}
-// CHECK-FIXES: {{^void SimpleCases::c\(\) {}}}
+// CHECK-FIXES: {{^}}void SimpleCases::c() {}
SimpleCases::~SimpleCases() {}
-// CHECK-FIXES: {{^SimpleCases::~SimpleCases\(\) {}}}
+// CHECK-FIXES: {{^}}SimpleCases::~SimpleCases() {}
struct DefaultedDestructor : public Base {
DefaultedDestructor() {}
virtual ~DefaultedDestructor() = default;
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: Prefer using
- // CHECK-FIXES: {{^ ~DefaultedDestructor\(\) override = default;}}
+ // CHECK-FIXES: {{^}} ~DefaultedDestructor() override = default;
};
struct FinalSpecified : public Base {
public:
virtual ~FinalSpecified() final;
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: Annotate this
- // CHECK-FIXES: {{^ ~FinalSpecified\(\) final;}}
+ // CHECK-FIXES: {{^}} ~FinalSpecified() final;
void b() final;
// CHECK-MESSAGES-NOT: warning:
- // CHECK-FIXES: {{^ void b\(\) final;}}
+ // CHECK-FIXES: {{^}} void b() final;
virtual void d() final;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void d\(\) final;}}
+ // CHECK-FIXES: {{^}} void d() final;
virtual void e() final = 0;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void e\(\) final = 0;}}
+ // CHECK-FIXES: {{^}} void e() final = 0;
virtual void j() const final;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void j\(\) const final;}}
+ // CHECK-FIXES: {{^}} void j() const final;
virtual bool l() final MUST_USE_RESULT UNUSED;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ bool l\(\) final MUST_USE_RESULT UNUSED;}}
+ // CHECK-FIXES: {{^}} bool l() final MUST_USE_RESULT UNUSED;
};
struct InlineDefinitions : public Base {
public:
virtual ~InlineDefinitions() {}
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: Prefer using
- // CHECK-FIXES: {{^ ~InlineDefinitions\(\) override {}}}
+ // CHECK-FIXES: {{^}} ~InlineDefinitions() override {}
void a() {}
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: Annotate this
- // CHECK-FIXES: {{^ void a\(\) override {}}}
+ // CHECK-FIXES: {{^}} void a() override {}
void b() override {}
// CHECK-MESSAGES-NOT: warning:
- // CHECK-FIXES: {{^ void b\(\) override {}}}
+ // CHECK-FIXES: {{^}} void b() override {}
virtual void c() {}
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void c\(\) override {}}}
+ // CHECK-FIXES: {{^}} void c() override {}
virtual void d() override {}
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ void d\(\) override {}}}
+ // CHECK-FIXES: {{^}} void d() override {}
virtual void j() const {}
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void j\(\) const override {}}}
+ // CHECK-FIXES: {{^}} void j() const override {}
virtual MustUseResultObject k() {} // Has an implicit attribute.
// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: Prefer using
- // CHECK-FIXES: {{^ MustUseResultObject k\(\) override {}}}
+ // CHECK-FIXES: {{^}} MustUseResultObject k() override {}
virtual bool l() MUST_USE_RESULT UNUSED {}
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ bool l\(\) override MUST_USE_RESULT UNUSED {}}}
+ // CHECK-FIXES: {{^}} bool l() override MUST_USE_RESULT UNUSED {}
};
struct Macros : public Base {
@@ -173,31 +173,31 @@ struct Macros : public Base {
// give up for now.
NOT_VIRTUAL void a() NOT_OVERRIDE;
// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: Annotate this
- // CHECK-FIXES: {{^ NOT_VIRTUAL void a\(\) override NOT_OVERRIDE;}}
+ // CHECK-FIXES: {{^}} NOT_VIRTUAL void a() override NOT_OVERRIDE;
VIRTUAL void b() NOT_OVERRIDE;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ VIRTUAL void b\(\) override NOT_OVERRIDE;}}
+ // CHECK-FIXES: {{^}} VIRTUAL void b() override NOT_OVERRIDE;
NOT_VIRTUAL void c() OVERRIDE;
// CHECK-MESSAGES-NOT: warning:
- // CHECK-FIXES: {{^ NOT_VIRTUAL void c\(\) OVERRIDE;}}
+ // CHECK-FIXES: {{^}} NOT_VIRTUAL void c() OVERRIDE;
VIRTUAL void d() OVERRIDE;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ VIRTUAL void d\(\) OVERRIDE;}}
+ // CHECK-FIXES: {{^}} VIRTUAL void d() OVERRIDE;
#define FUNC(return_type, name) return_type name()
FUNC(void, e);
- // CHECK-FIXES: {{^ FUNC\(void, e\);}}
+ // CHECK-FIXES: {{^}} FUNC(void, e);
#define F virtual void f();
F
- // CHECK-FIXES: {{^ F}}
+ // CHECK-FIXES: {{^}} F
VIRTUAL void g() OVERRIDE final;
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Annotate this
- // CHECK-FIXES: {{^ VIRTUAL void g\(\) final;}}
+ // CHECK-FIXES: {{^}} VIRTUAL void g() final;
};
// Tests for templates.
@@ -208,7 +208,7 @@ template <typename T> struct TemplateBas
template <typename T> struct DerivedFromTemplate : public TemplateBase<T> {
virtual void f(T t);
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Prefer using
- // CHECK-FIXES: {{^ void f\(T t\) override;}}
+ // CHECK-FIXES: {{^}} void f(T t) override;
};
void f() { DerivedFromTemplate<int>().f(2); }
@@ -216,7 +216,7 @@ template <class C>
struct UnusedMemberInstantiation : public C {
virtual ~UnusedMemberInstantiation() {}
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: Prefer using
- // CHECK-FIXES: {{^ ~UnusedMemberInstantiation\(\) override {}}}
+ // CHECK-FIXES: {{^}} ~UnusedMemberInstantiation() override {}
};
struct IntantiateWithoutUse : public UnusedMemberInstantiation<Base> {};
@@ -231,7 +231,7 @@ template <int I>
struct MembersOfSpecializations : public Base2 {
void a() override;
// CHECK-MESSAGES-NOT: warning:
- // CHECK-FIXES: {{^ void a\(\) override;}}
+ // CHECK-FIXES: {{^}} void a() override;
};
template <> void MembersOfSpecializations<3>::a() {}
void ff() { MembersOfSpecializations<3>().a(); };
More information about the cfe-commits
mailing list