[PATCH] Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.

Alexander Kornienko alexfh at google.com
Sat Jul 12 05:49:16 PDT 2014


Hi djasper, sbenza,

http://reviews.llvm.org/D4480

Files:
  test/clang-tidy/check_clang_tidy_fix.sh
  test/clang-tidy/redundant-smartptr-get.cpp
  test/clang-tidy/use-override.cpp

Index: test/clang-tidy/check_clang_tidy_fix.sh
===================================================================
--- test/clang-tidy/check_clang_tidy_fix.sh
+++ test/clang-tidy/check_clang_tidy_fix.sh
@@ -19,5 +19,6 @@
 
 if grep -q CHECK-MESSAGES ${INPUT_FILE}; then
   FileCheck -input-file=${TEMPORARY_FILE}.msg ${INPUT_FILE} \
-    -check-prefix=CHECK-MESSAGES -implicit-check-not="warning:" || exit $?
+    -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:" \
+    || exit $?
 fi
Index: test/clang-tidy/redundant-smartptr-get.cpp
===================================================================
--- test/clang-tidy/redundant-smartptr-get.cpp
+++ test/clang-tidy/redundant-smartptr-get.cpp
@@ -1,17 +1,19 @@
 // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-redundant-smartptr-get %t
 // REQUIRES: shell
 
+#define NULL __null
+
 namespace std {
 
 template <typename T>
-class unique_ptr {
+struct unique_ptr {
   T& operator*() const;
   T* operator->() const;
   T* get() const;
 };
 
 template <typename T>
-class shared_ptr {
+struct shared_ptr {
   T& operator*() const;
   T* operator->() const;
   T* get() const;
Index: test/clang-tidy/use-override.cpp
===================================================================
--- test/clang-tidy/use-override.cpp
+++ test/clang-tidy/use-override.cpp
@@ -82,8 +82,8 @@
 
 // CHECK-MESSAGES-NOT: warning:
 
-void SimpleCases::i() {}
-// CHECK-FIXES: {{^void SimpleCases::i\(\) {}}}
+void SimpleCases::c() {}
+// CHECK-FIXES: {{^void SimpleCases::c\(\) {}}}
 
 SimpleCases::~SimpleCases() {}
 // CHECK-FIXES: {{^SimpleCases::~SimpleCases\(\) {}}}
@@ -176,7 +176,7 @@
   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: Use exactly
   // CHECK-FIXES: {{^  VIRTUAL void d\(\) OVERRIDE;}}
 
-#define FUNC(name, return_type) return_type name()
+#define FUNC(return_type, name) return_type name()
   FUNC(void, e);
   // CHECK-FIXES: {{^  FUNC\(void, e\);}}
 
@@ -209,13 +209,18 @@
 };
 struct IntantiateWithoutUse : public UnusedMemberInstantiation<Base> {};
 
+struct Base2 {
+  virtual ~Base2() {}
+  virtual void a();
+};
+
 // The OverrideAttr isn't propagated to specializations in all cases. Make sure
 // we don't add "override" a second time.
 template <int I>
-struct MembersOfSpecializations : public Base {
+struct MembersOfSpecializations : public Base2 {
   void a() override;
   // CHECK-MESSAGES-NOT: warning:
   // CHECK-FIXES: {{^  void a\(\) override;}}
 };
 template <> void MembersOfSpecializations<3>::a() {}
-void f() { MembersOfSpecializations<3>().a(); };
+void ff() { MembersOfSpecializations<3>().a(); };
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4480.11335.patch
Type: text/x-patch
Size: 2607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140712/a0c4083b/attachment.bin>


More information about the cfe-commits mailing list