File tree Expand file tree Collapse file tree 2 files changed +62
-1
lines changed Expand file tree Collapse file tree 2 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,6 @@ void CXX20ModulesGenerator::HandleTranslationUnit(ASTContext &Ctx) {
114114 getPreprocessor ().getHeaderSearchInfo ().getHeaderSearchOpts ();
115115 HSOpts.ModulesSkipDiagnosticOptions = true ;
116116 HSOpts.ModulesSkipHeaderSearchPaths = true ;
117- HSOpts.ModulesSkipPragmaDiagnosticMappings = true ;
118117
119118 PCHGenerator::HandleTranslationUnit (Ctx);
120119
Original file line number Diff line number Diff line change 1+ // RUN: rm -rf %t
2+ // RUN: mkdir -p %t
3+ // RUN: split-file %s %t
4+ //
5+ // Treat the behavior of using headers as baseline.
6+ // RUN: %clang_cc1 -std=c++20 %t/use-header.cc -isystem %t -fsyntax-only -verify
7+ //
8+ // RUN: %clang_cc1 -std=c++20 %t/a.cppm -isystem %t -emit-module-interface -o %t/a.pcm
9+ // RUN: %clang_cc1 -std=c++20 %t/use-module.cc -isystem %t -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
10+
11+ // --- sys.h
12+ #ifndef SYS_H
13+ #define SYS_H
14+
15+ #pragma GCC system_header
16+
17+ template <class C >
18+ struct [[deprecated]] iterator {};
19+
20+ _Pragma (" GCC diagnostic push" )
21+ _Pragma (" GCC diagnostic ignored \" -Wdeprecated\" " )
22+ _Pragma (" GCC diagnostic ignored \" -Wdeprecated-declarations\" " )
23+
24+ template <class C >
25+ struct reverse_iterator
26+ : public iterator<C> {};
27+
28+ _Pragma (" GCC diagnostic pop" )
29+
30+ template <class T >
31+ class C {
32+ public:
33+ void i () {
34+ reverse_iterator<T> i;
35+ }
36+ };
37+
38+ #endif
39+
40+ // --- use-header.cc
41+ // expected-no-diagnostics
42+ // However, we see unexpected warnings
43+ #include < sys.h>
44+
45+ void use () {
46+ C<int >().i ();
47+ }
48+
49+ // --- a.cppm
50+ module ;
51+ #include < sys.h>
52+ export module a;
53+ export using ::iterator;
54+ export using ::C;
55+
56+ // --- use-module.cc
57+ // expected-no-diagnostics
58+ import a;
59+
60+ void use () {
61+ C<int >().i ();
62+ }
You can’t perform that action at this time.
0 commit comments