title: cLion & cMake not debugning/printing an error
body: <p>I have a weird issue that I just learned about. If I run this code in Visual Studio I get output that is NULL/error. But when I run in cLion I just get app crash and no feedback.</p>
  
  <p>VS error :</p>
  
  <pre><code>Exception thrown: read access violation.
  this was nullptr.
  </code></pre>
  
  <p>Here is my config:</p>
  
  <p>main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class testNothing {
  public:
      testNothing *test;
      void donothing() { cout &lt;&lt; test &lt;&lt; endl; };
  };
  
  int main()
  {
      testNothing *hey = nullptr;
  
      hey-&gt;donothing();
  
      return 1;
  };
  </code></pre>
  
  <p>CMakeList.txt</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.8)
  project(tests)
  set(CMAKE_CXX_STANDARD 14)
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  set(CMAKE_AUTOMOC ON)
  set(CMAKE_AUTOUIC ON)
  set(SOURCE_FILES main.cpp)
  add_executable(${PROJECT_NAME} ${SOURCE_FILES})
  </code></pre>