title: running clang scan-build with g++ on linux
body: <p>I have the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;memory&gt;
  
  using namespace std;
  
  class A
  {
      public:
          void foo() const;
  };
  
  void A::foo() const {}
  
  std::unique_ptr&lt;A&gt; foo2()
  {
      std::unique_ptr&lt;A&gt; pa(new A());
      return pa;
  }
  
  void
  foo()
  {
      const A&amp; ra = *foo2();
      ra.foo();
  }
  
  int
  main()
  {
      foo();
      return 0;
  }
  </code></pre>
  
  <p>I am trying to use clang's scan-build:</p>
  
  <pre><code>scan-build g++ --std=c++11 unique_ptr.cpp
  </code></pre>
  
  <p>This program compiles and runs fine with g++.
  I am using CentOS and clang3.8 and g++4.8.5.</p>
  
  <p>Error Message:</p>
  
  <pre><code> error: no type named 'unique_ptr' in namespace 'std'
   std::unique_ptr&lt;A&gt; foo2()
   ~~~~~^
  </code></pre>