[cfe-commits] r158146 - /cfe/trunk/unittests/Tooling/RewriterTestContext.h
Craig Topper
craig.topper at gmail.com
Thu Jun 7 09:55:45 PDT 2012
Doesn't that function return "error_code" not bool?
On Thu, Jun 7, 2012 at 2:57 AM, Benjamin Kramer <benny.kra at googlemail.com>wrote:
> Author: d0k
> Date: Thu Jun 7 04:57:21 2012
> New Revision: 158146
>
> URL: http://llvm.org/viewvc/llvm-project?rev=158146&view=rev
> Log:
> Move sideeffecting call out of assert().
>
> Modified:
> cfe/trunk/unittests/Tooling/RewriterTestContext.h
>
> Modified: cfe/trunk/unittests/Tooling/RewriterTestContext.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RewriterTestContext.h?rev=158146&r1=158145&r2=158146&view=diff
>
> ==============================================================================
> --- cfe/trunk/unittests/Tooling/RewriterTestContext.h (original)
> +++ cfe/trunk/unittests/Tooling/RewriterTestContext.h Thu Jun 7 04:57:21
> 2012
> @@ -63,8 +63,10 @@
> FileID createOnDiskFile(StringRef Name, StringRef Content) {
> if (TemporaryDirectory.empty()) {
> int FD;
> -
> assert(!llvm::sys::fs::unique_file("rewriter-test-%%-%%-%%-%%/anchor",
> - FD, TemporaryDirectory));
> + bool error =
> + llvm::sys::fs::unique_file("rewriter-test-%%-%%-%%-%%/anchor", FD,
> + TemporaryDirectory);
> + assert(!error); (void)error;
> llvm::raw_fd_ostream Closer(FD, /*shouldClose=*/true);
> TemporaryDirectory =
> llvm::sys::path::parent_path(TemporaryDirectory);
> }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
--
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120607/3823b75f/attachment.html>
More information about the cfe-commits
mailing list