Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8537985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:02:01+00:00 2026-06-11T11:02:01+00:00

I think I found a bug in the libc++ list implementation. The following code

  • 0

I think I found a bug in the libc++ list implementation. The following code will produce a compiler error (Field has incomlete type ‘foo’) when using certain build settings in xcode:

#include <list>

using namespace std;

class foo {
    public:
        list<foo> bar;
};

The settings are the following:

XCode Version: 4.4.1
C++ Language Dialect: C++11 or GNU++11
C++ Standard library: LLVM C++ standard library with C++ extensions (libc++11)

Using GCCs libstdc++ will resolve the error.
Not using the C++11 dialect will resolve the error.
Using vector instead of list will resolve the error.

I think it is a bug in the list implementation, but I am not sure.
Forgive my ignorance, but I don’t know what I should do to resolve this issue.
Switching to vector is not an option in my project and I definitely need C++11 features. That also includes shared_ptr, but the headers are missing when using GCC. Beside that, apple does not seem to provide new versions of GCC anymore.

I would very appreciate it if somebody could recreate this issue, maybe with newer header from libc++.

Also, if updating LLVM/libc++ would resolve this issue, do you recommend it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:02:03+00:00Added an answer on June 11, 2026 at 11:02 am

    C++ Standard 17.6.4.8:

    In certain cases (replacement functions, handler functions, operations on types used to instantiate standard library template components), the C++ standard library depends on components supplied by a C++ program. If these components do not meet their requirements, the Standard places no requirements on the implementation.

    In particular, the effects are undefined in the following cases:

    • …
    • if an incomplete type (3.9) is used as a template argument when instantiating a template component,
      unless specifically allowed for that component.

    None of the standard library’s container class templates, including list, mention any such allowance for an incomplete type. So your program is an invalid one that might happen to work with some compilers. That can’t be considered a bug in the standard library implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I've found a bug in safari. I wondered if anyone has encountered
What if I think, that I found a bug in an open-source-app? What steps
I've found what I think may be a bug with Ivar and Objective-C runtime.
While searching a bug in my code today I found a strange thing. When
I think I have found a bug when setting or getting the Me.Top property
I think I may have found a bug in PHP's crypt() function under Windows.
I found an interesting bug and wanted to know you think. Brief background: I've
I think I've found a bug in IE's (IE8) handling for the for-in javascript
I think I've just found a really strange bug... But it can just be
I think I found a bug in opencart so in the featured module there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.