On Wed, Jul 23, 2014 at 2:40 AM, Richard Smith <[email protected]> wrote:
> On Tue, Jul 22, 2014 at 5:30 AM, Benjamin Kramer <[email protected] > > wrote: > >> ... >> Added: clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp?rev=213647&view=auto >> >> ============================================================================== >> --- clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp (added) >> +++ clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp Tue Jul >> 22 07:30:35 2014 >> @@ -0,0 +1,61 @@ >> +// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-unused-raii %t >> +// REQUIRES: shell >> + >> +struct Foo { >> + Foo(); >> + Foo(int); >> + Foo(int, int); >> + ~Foo(); >> +}; >> + >> +struct Bar { >> + Bar(); >> + Foo f; >> +}; >> + >> +template <typename T> >> +void qux() { >> + T(42); >> +} >> + >> +template <typename T> >> +struct TFoo { >> + TFoo(T); >> + ~TFoo(); >> +}; >> + >> +Foo f(); >> + >> +struct Ctor { >> + Ctor(int); >> + Ctor() { >> + Ctor(0); // TODO: warn here. >> + } >> +}; >> + >> +void test() { >> + Foo(42); >> +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately >> after creation; did you mean to name the object? >> +// CHECK-FIXES: Foo give_me_a_name(42); >> + Foo(23, 42); >> +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately >> after creation; did you mean to name the object? >> +// CHECK-FIXES: Foo give_me_a_name(23, 42); >> + Foo(); >> +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately >> after creation; did you mean to name the object? >> +// CHECK-FIXES: Foo give_me_a_name; >> + TFoo<int>(23); >> +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: object destroyed immediately >> after creation; did you mean to name the object? >> +// CHECK-FIXES: TFoo<int> give_me_a_name(23); >> > > This test is failing on one of our bots: > The "on one of our bots" part could be more specific, ideally with a link. Benjamin, can you reproduce the failure? I gather, the buildbot should have sent you a personal mail? > > misc-unused-raii.cpp:39:17: error: expected string not found in input > // CHECK-FIXES: Foo give_me_a_name(42); > ^ > misc-unused-raii.cpp.tmp.cpp:1:1: note: scanning from here > // > ^ > misc-unused-raii.cpp.tmp.cpp:37:3: note: possible intended match here > Foo(42); > ^ > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
