<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:hhinnant@apple.com" title="Howard Hinnant <hhinnant@apple.com>"> <span class="fn">Howard Hinnant</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - std::pair: incomplete type error in template class instantiation."
   href="http://llvm.org/bugs/show_bug.cgi?id=16801">bug 16801</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>DUPLICATE
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - std::pair: incomplete type error in template class instantiation."
   href="http://llvm.org/bugs/show_bug.cgi?id=16801#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - std::pair: incomplete type error in template class instantiation."
   href="http://llvm.org/bugs/show_bug.cgi?id=16801">bug 16801</a>
              from <span class="vcard"><a class="email" href="mailto:hhinnant@apple.com" title="Howard Hinnant <hhinnant@apple.com>"> <span class="fn">Howard Hinnant</span></a>
</span></b>
        <pre>This is a duplicate of 13471.  The mmap is still being instantiated with
incomplete type c at:

    typename mmap::iterator i_;

Implementations of map, including libc++ in C++03 mode, go to extra lengths to
try to allow this code as an extension.  However the addition of noexcept throw
specs to various members make such extensions increasingly difficult, if not
impossible.

It is because the noexcept specs are #ifdef'd out in C++03 mode that allows
libc++ to swallow this in C++03 mode.

You could try this instead:

template <typename K, typename V>
struct C
{
  struct c;
  typedef std::map<K, c> mmap;

  struct c
  {
    V                       v_;
    std::pair<const K, c>*  i_;
  };

  mmap m_;
};

int main()
{
  C<char, int> cc;

  return 0;
}

*** This bug has been marked as a duplicate of <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - STL and incomplete types problem with libc++, works without libc++"
   href="show_bug.cgi?id=13471">bug 13471</a> ***</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>