[cfe-commits] r158146 - /cfe/trunk/unittests/Tooling/RewriterTestContext.h
Benjamin Kramer
benny.kra at googlemail.com
Thu Jun 7 02:57:21 PDT 2012
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);
}
More information about the cfe-commits
mailing list