Skip to content

Commit

Permalink
Get the conditional right this time. Sigh.
Browse files Browse the repository at this point in the history
Change-Id: Ib0823f63eee9f53dfe0d38184de02bed2acf99a9
Reviewed-on: https://code-review.googlesource.com/c/re2/+/57992
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Oct 13, 2020
1 parent 703e42e commit fd2a80f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions re2/re2.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ class RE2::Arg {
re2_internal::Parse4ary<T>::value,
int>::type;

#if !defined(__clang__) && defined(_MSC_VER)
#if !defined(_MSC_VER)
template <typename T>
using CanParseFrom = typename std::enable_if<
std::is_member_function_pointer<decltype(
Expand All @@ -845,7 +845,7 @@ class RE2::Arg {
template <typename T, CanParse4ary<T> = 0>
Arg(T* ptr) : arg_(ptr), parser_(DoParse4ary<T>) {}

#if !defined(__clang__) && defined(_MSC_VER)
#if !defined(_MSC_VER)
template <typename T, CanParseFrom<T> = 0>
Arg(T* ptr) : arg_(ptr), parser_(DoParseFrom<T>) {}
#endif
Expand Down Expand Up @@ -874,7 +874,7 @@ class RE2::Arg {
return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 10);
}

#if !defined(__clang__) && defined(_MSC_VER)
#if !defined(_MSC_VER)
template <typename T>
static bool DoParseFrom(const char* str, size_t n, void* dest) {
if (dest == NULL) return true;
Expand Down
2 changes: 1 addition & 1 deletion re2/testing/re2_arg_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ TEST(RE2ArgTest, Uint64Test) {
}

TEST(RE2ArgTest, ParseFromTest) {
#if !defined(__clang__) && defined(_MSC_VER)
#if !defined(_MSC_VER)
struct {
bool ParseFrom(const char* str, size_t n) {
LOG(INFO) << "str = " << str << ", n = " << n;
Expand Down

0 comments on commit fd2a80f

Please sign in to comment.