diff options
| author | Edwin Vane <edwin.vane@intel.com> | 2013-05-14 17:34:12 +0000 |
|---|---|---|
| committer | Edwin Vane <edwin.vane@intel.com> | 2013-05-14 17:34:12 +0000 |
| commit | ba6a0960ea9af44f398827a6f6b8795b5e90154c (patch) | |
| tree | 2036fc015e19ba5a44db3c680a437fab439c2dfc /clang-tools-extra/test | |
| parent | 2dca82ad1c89083328d87487ee5db8b361bae6c0 (diff) | |
| download | bcm5719-llvm-ba6a0960ea9af44f398827a6f6b8795b5e90154c.tar.gz bcm5719-llvm-ba6a0960ea9af44f398827a6f6b8795b5e90154c.zip | |
cpp11-migrate: Add override specifier before comments on inline methods
This commit fixes a "FIXME" in the add-override transform. ' override' was
misplaced when a comment was between the function body and the end of the
'prototype'.
It also remove duplicated check for the main file from the last commit (and
fixes the typo in the comment above).
Author: Guillaume Papin <guillaume.papin@epitech.eu>
llvm-svn: 181806
Diffstat (limited to 'clang-tools-extra/test')
| -rw-r--r-- | clang-tools-extra/test/cpp11-migrate/AddOverride/basic.cpp | 4 | ||||
| -rw-r--r-- | clang-tools-extra/test/cpp11-migrate/AddOverride/comment_before_inline_body_fail.cpp | 25 |
2 files changed, 4 insertions, 25 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/AddOverride/basic.cpp b/clang-tools-extra/test/cpp11-migrate/AddOverride/basic.cpp index 1c1c95d8146..4bc471015df 100644 --- a/clang-tools-extra/test/cpp11-migrate/AddOverride/basic.cpp +++ b/clang-tools-extra/test/cpp11-migrate/AddOverride/basic.cpp @@ -57,8 +57,12 @@ public: class G : public A { public: void h() const; // comment + void i() // comment + {} // CHECK: class G // CHECK: void h() const override; // comment + // CHECK: void i() override // comment + // CHECK-NEXT: {} }; // Test that override is placed correctly if there is an inline body. diff --git a/clang-tools-extra/test/cpp11-migrate/AddOverride/comment_before_inline_body_fail.cpp b/clang-tools-extra/test/cpp11-migrate/AddOverride/comment_before_inline_body_fail.cpp deleted file mode 100644 index 57c2ab0453f..00000000000 --- a/clang-tools-extra/test/cpp11-migrate/AddOverride/comment_before_inline_body_fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp -// RUN: cpp11-migrate -add-override %t.cpp -- -I %S -// RUN: FileCheck -input-file=%t.cpp %s -// XFAIL: * - -class A { -public: - virtual void h() const; - // CHECK: virtual void h() const; -}; - -// Test that the override is correctly placed if there -// is an inline comment between the function declaration -// and the function body. -// This test fails with the override keyword being added -// to the end of the comment. This failure occurs because -// the insertion point is incorrectly calculated if there -// is an inline comment before the method body. -class B : public A { -public: - virtual void h() const // comment - { } - // CHECK: virtual void h() const override -}; - |

