Skip to content

Commit

Permalink
Have lldb_assert accept bool expressions
Browse files Browse the repository at this point in the history
Summary:
This changes lldb_assert to accept bool expressions as the parameter, this is because some
objects (such as std::shared_ptr) are convertible to bool, but are not convertible to int, which
leads to surprising errors.

Reviewers: granata.enrico, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9565

llvm-svn: 236819
  • Loading branch information
labath committed May 8, 2015
1 parent 85fadd9 commit 014d32b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lldb/include/lldb/Utility/LLDBAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace lldb_private {
void
lldb_assert (int expression,
lldb_assert (bool expression,
const char* expr_text,
const char* func,
const char* file,
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Utility/LLDBAssert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using namespace llvm;
using namespace lldb_private;

void
lldb_private::lldb_assert (int expression,
lldb_private::lldb_assert (bool expression,
const char* expr_text,
const char* func,
const char* file,
Expand Down

0 comments on commit 014d32b

Please sign in to comment.