Skip to content

#include <span> recognized as C system header #211

Description

@michael-projectx

I have the following set of includes in my header file:

#include <algorithm>
#include <iostream>
#include <span>
#include <vector>

If I leave them in this order, then I get the following error message:

Found C system header after C++ system header. Should be: stream_helpers.h, c system, c++ system, other. [build/include_order] [4]

In order to make the linter happy, I need to do this:

#include <span>
// ^^ Linter things <span> is a C system header :(
#include <algorithm>
#include <iostream>
#include <vector>

If I don't include the // comment below the #include <span> line, then my clang-format rule reorders the headers alphabetically but then cpplint fails.

How do I go about fixing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions