[LLVMbugs] [Bug 16801] std::pair: incomplete type error in template class instantiation.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 6 08:06:09 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16801

Howard Hinnant <hhinnant at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Howard Hinnant <hhinnant at apple.com> ---
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 bug 13471 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130806/2c650ede/attachment.html>


More information about the llvm-bugs mailing list