diff options
Diffstat (limited to 'clang-tools-extra/test/clang-rename/NoNewName.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-rename/NoNewName.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-rename/NoNewName.cpp b/clang-tools-extra/test/clang-rename/NoNewName.cpp new file mode 100644 index 00000000000..a706f4263e1 --- /dev/null +++ b/clang-tools-extra/test/clang-rename/NoNewName.cpp @@ -0,0 +1,20 @@ +// This test is a copy of ConstCastExpr.cpp with a single change: +// -new-name hasn't been passed to clang-rename, so this test should give an +// error. +// RUN: not clang-rename -offset=133 %s 2>&1 | FileCheck %s +// CHECK: clang-rename: no new name provided. + +class Cla { +public: + int getValue() { + return 0; + } +}; + +int main() { + const Cla *C = new Cla(); + const_cast<Cla *>(C)->getValue(); +} + +// Use grep -FUbo 'Cla' <file> to get the correct offset of foo when changing +// this file. |