title: GoogleTest: CLang error compiling ASSERT_FALSE(false)
body: <p>I downloaded <a href="https://github.com/google/googletest" rel="nofollow">googletest</a> and built it in a subdirectory named <code>build</code>.<br>
  Then, I wrote the following code in a file named <code>main.cpp</code>:</p>
  
  <pre><code>#include &lt;gtest/gtest.h&gt;
  TEST(FOO, BAR) { ASSERT_FALSE(false); }
  </code></pre>
  
  <p>Quite simple indeed.<br>
  It relies on the fact that a <code>main</code> function is already provided with <em>googletest</em> if you link the <code>libgtestmain.a</code> library.</p>
  
  <p>GCC (v5.3.1) compiles it using the following command:</p>
  
  <pre><code>g++ -L./googletest/build/googlemock/gtest -L./googletest/build/googlemock -I./googletest/googletest/include/ -lgmock -lgtest -lgtest_main -lgmock_main -pthread -std=c++11 main.cpp
  </code></pre>
  
  <p>Anyway, clang (v3.6.2) does not compile using the same command:</p>
  
  <pre><code>clang++ -L./googletest/build/googlemock/gtest -L./googletest/build/googlemock -I./googletest/googletest/include/ -lgmock -lgtest -lgtest_main -lgmock_main -pthread -std=c++11 main.cpp
  </code></pre>
  
  <p>The error is the following one:</p>
  
  <blockquote>
    <p>/tmp/main-4127ae.o: In function 'FOO_BAR_Test::TestBody()':<br>
    main.cpp:(.text+0x7b): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&amp;, char const*, char const*, char const*)'<br>
    clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>
  </blockquote>
  
  <p>The code contains almost the sole <code>ASSERT_FALSE(false)</code> statement (that's a minimal, complete example and still it doesn't compile), so I'd say that the problem is not in the code itself.<br>
  The same problem arises also from the following statement:</p>
  
  <pre><code>TEST(FOO, BAR) { ASSERT_TRUE(true); }
  </code></pre>
  
  <p>Is that an issue due to <em>googletest</em>, to <em>clang</em> or whatever?<br>
  I'm trying to figure it out, but I'm a little bit in trouble while looking at the code of <em>googletest</em>.</p>
  
  <p><strong>NOTE</strong></p>
  
  <p>I've not been able to find neither an open nor a closed issue for <em>googletest</em>, so I'm to open also a ticket for it on <em>github</em>.<br>
  In a while I'll probably post the link to the issue.</p>