Skip to content

bugprone-nondeterministic-pointer-iteration-order is only reported with libc++ #145667

Open
@firewave

Description

@firewave
#include <algorithm>
#include <vector>

struct S;

void f()
{
    std::vector<const S*> v;
    std::sort(v.begin(), v.end());
}
<source>:6:23: error: unknown type name 'S' [clang-diagnostic-error]
    6 |     std::vector<const S*> v;
      |                       ^

The warning is only shown when using libc++.

libstdc++: https://godbolt.org/z/543cGGnqq
libc++: https://godbolt.org/z/1Th935cvz

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions