[clang-tools-extra] r212876 - Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.

Alexander Kornienko alexfh at google.com
Sat Jul 12 06:17:00 PDT 2014


Author: alexfh
Date: Sat Jul 12 08:16:58 2014
New Revision: 212876

URL: http://llvm.org/viewvc/llvm-project?rev=212876&view=rev
Log:
Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.

Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4480

Modified:
    clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
    clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp
    clang-tools-extra/trunk/test/clang-tidy/use-override.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh?rev=212876&r1=212875&r2=212876&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh (original)
+++ clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh Sat Jul 12 08:16:58 2014
@@ -19,5 +19,6 @@ FileCheck -input-file=${TEMPORARY_FILE}
 
 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

Modified: clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp?rev=212876&r1=212875&r2=212876&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/redundant-smartptr-get.cpp Sat Jul 12 08:16:58 2014
@@ -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;

Modified: clang-tools-extra/trunk/test/clang-tidy/use-override.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/use-override.cpp?rev=212876&r1=212875&r2=212876&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/use-override.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/use-override.cpp Sat Jul 12 08:16:58 2014
@@ -82,8 +82,8 @@ public:
 
 // 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 @@ struct Macros : public Base {
   // 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 UnusedMemberInstantiation : publi
 };
 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(); };





More information about the cfe-commits mailing list