title: Eclipse polymorphism using C++11 shared_ptr error
body: <p>Given the following sample code:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;memory&gt;
  using namespace std;
  
  struct A {
  public:
      A(int aa) : a(aa) {}
      int a;
      virtual ~A() {}
  };
  struct B : A {
  public:
      B(int aa, int bb) : A(aa), b(bb) {}
      int b;
  };
  
  void f(shared_ptr&lt;A&gt; a){
      shared_ptr&lt;B&gt; b = dynamic_pointer_cast&lt;B&gt;(a);
      if (b) {
          cout &lt;&lt; b-&gt;b &lt;&lt; endl;
      } else {
          cout &lt;&lt; a-&gt;a &lt;&lt; endl;
      }
  }
  
  int main() {
      auto a = make_shared&lt;A&gt;(3);
      auto b = make_shared&lt;B&gt;(7, 4);
      f(a);
      f(b);
      return 0;
  }
  </code></pre>
  
  <p>Eclipse indicates that there is an error on the line</p>
  
  <pre><code>f(b);
  </code></pre>
  
  <p>saying <code>Invalid arguments ' Candidates are: void f(std::shared_ptr&lt;A&gt;) '</code><br>
  because a <code>shared_ptr&lt;B&gt;</code> has been passed. This compiles and runs, and has output:</p>
  
  <pre><code>3
  4
  </code></pre>
  
  <p>as expected.</p>
  
  <p>The indexer and compiler have -std=c++11 specified.<br>
  The compiler also has the symbol <code>__GXX_EXPERIMENTAL_CXX0X__</code> defined.</p>
  
  <p>Is there any way to get rid of this error and its red squiggles in Eclipse (preferably without modifying the source)?</p>