<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:marejde@gmail.com" title="Martin Ejdestig <marejde@gmail.com>"> <span class="fn">Martin Ejdestig</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - New diagnostic -Wzero-as-null-pointer-constant warns on macros expanded from system headers."
href="https://bugs.llvm.org/show_bug.cgi?id=33771">bug 33771</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>marejde@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>FIXED
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - New diagnostic -Wzero-as-null-pointer-constant warns on macros expanded from system headers."
href="https://bugs.llvm.org/show_bug.cgi?id=33771#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - New diagnostic -Wzero-as-null-pointer-constant warns on macros expanded from system headers."
href="https://bugs.llvm.org/show_bug.cgi?id=33771">bug 33771</a>
from <span class="vcard"><a class="email" href="mailto:marejde@gmail.com" title="Martin Ejdestig <marejde@gmail.com>"> <span class="fn">Martin Ejdestig</span></a>
</span></b>
<pre>I am reopening this. It still occurs with Clang 6.0 in googletest even if
-isystem is used. It works as expected with GCC (no warning). A git clone of
googletest is checked out in external/googletest.
$ cat foo.cpp:
#include <gtest/gtest.h>
TEST(Foo, Bar)
{
EXPECT_EQ(0, 1);
}
$ clang++ -Werror -Wzero-as-null-pointer-constant -isystem
external/googletest/googletest/include -o 'foo.o' -c foo.cpp
foo.cpp:5:12: error: zero as null pointer constant
[-Werror,-Wzero-as-null-pointer-constant]
EXPECT_EQ(0, 1);
^
nullptr
external/googletest/googletest/include/gtest/gtest.h:1924:55: note: expanded
from macro 'EXPECT_EQ'
EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
^
external/googletest/googletest/include/gtest/internal/gtest-internal.h:133:54:
note: expanded from macro 'GTEST_IS_NULL_LITERAL_'
(sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
^
external/googletest/googletest/include/gtest/gtest_pred_impl.h:162:23: note:
expanded from macro 'EXPECT_PRED_FORMAT2'
GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
^
external/googletest/googletest/include/gtest/gtest_pred_impl.h:147:17: note:
expanded from macro 'GTEST_PRED_FORMAT2_'
GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
^
external/googletest/googletest/include/gtest/gtest_pred_impl.h:77:52: note:
expanded from macro 'GTEST_ASSERT_'
if (const ::testing::AssertionResult gtest_ar = (expression)) \
^
1 error generated.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>