title: Clang does not compile a g++ project
body: <p>When trying to compile a <code>g++</code> project with the <code>clang</code> compiler, there is a strange error showing up.</p>
  
  <p>Here is the snippet of the source file:</p>
  
  <pre><code>std::set&lt;TTransportNetworkId&gt; l_transportNetworkIds;
  SelectionResultContainer l_searchResult = p_repo.rootMoc() / LnAny("LNBTS") / LnAny("LNMME");
  
      BOOST_FOREACH(const SelectionResult &amp; l_lnmmeSR, l_searchResult)
      {
          const MoLnmme &amp; l_lnmme = l_lnmmeSR;
          l_transportNetworkIds.insert(*l_lnmme.transportNwId);
      }
  </code></pre>
  
  <p>The error message is:</p>
  
  <pre><code>conditional expression is ambiguous; 'rvalue_probe&lt;Rrom::DataRep::SelectionResultContainer&gt;' can be converted to 'Rrom::DataRep::SelectionResultContainer' and vice versa
  BOOST_FOREACH(const SelectionResult &amp; l_lnmmeSR, l_searchResult)
  </code></pre>
  
  <p>Conditions are:</p>
  
  <ul>
  <li><p>The file compiles fine with <code>gcc_4.3.2</code> </p></li>
  <li><p><code>clang</code> in version 3.2 throws the above error</p></li>
  <li><p>Already tried to include the latest <code>boost</code> library which results in the same error</p></li>
  </ul>
  
  <p>My guess is that <code>clang</code> handles rvalue conditions differently than this <code>gcc</code> version does.</p>
  
  <p><code>clang</code> is supposed to be a drop-in-replacement for <code>gcc</code>, so how can one get rid of this error without touching the source file?</p>
  
  <p>Are there any options in <code>clang</code> which somehow disables these kind of errors?!</p>
  
  <p><strong>UPDATE:</strong>
  I could create an example source file, which you can reproduce for yourself:</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;boost/foreach.hpp&gt;
  
  class A : public std::vector&lt;int&gt;
  {
  public:
      template &lt;class T&gt;
      operator const T &amp;() const;   
  };
  
  void foo(){
     A colA;
     int b = 1;
     BOOST_FOREACH(b, colA)
     {
          ;
     } 
  }
  </code></pre>
  
  <p>When compiled with <code>clang 3.2</code> the above error is raised, with some additional insights to where exactly the error occurs:</p>
  
  <pre><code>error: conditional expression is ambiguous; 'rvalue_probe&lt;A&gt;' can be converted to 'A' and vice versa BOOST_FOREACH(b, colA)
  
  expanded from macro 'BOOST_FOREACH' f (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL))
  
  expanded from macro 'BOOST_FOREACH_CONTAIN' BOOST_FOREACH_EVALUATE(COL)
  
  expanded from macro 'BOOST_FOREACH_EVALUATE' (true ? boost::foreach_detail_::make_probe((COL), BOOST_FOREACH_ID(_foreach_is_rvalue)) : (COL))
  </code></pre>
  
  <p>This code is compiled without errors with <code>gcc_4.7.2</code>.
  Any ideas why the two compilers behave differently?</p>