Skip to content

[clang] [diagnostics] Now the diagnostic message for std headers should mention std module too #172966

@ChuanqiXu9

Description

@ChuanqiXu9

Reproducer:

class A {};
auto f() {
    return typeid(A);
}

Now we get:

<source>:3:12: error: you need to include <typeinfo> before using the 'typeid' operator
    3 |     return typeid(A);
      |            ^

but I think we should say "or import std" too. As now both libc++, libstdc++ and MSSTL supports std module and clang is able to compile all of them.

There may be other similar examples.

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:modulesC++20 modules and Clang Header Modulesgood first issuehttps://github.com/llvm/llvm-project/contribute

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions