-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++20] [Modules] [Serialization] Don't record '#pragma once' informa…
…tion in named modules Close #77995 The cause of the issue is that straight forward that we recorded the '#pragma once' information in named modules, which is an overlook. I tried to not record the header's information completely within named modules. But the tests look not happy with some diagnosing problems, which needs to be looked in details.
- Loading branch information
1 parent
9c4cd79
commit 7bc170a
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: rm -rf %t | ||
// RUN: mkdir -p %t | ||
// RUN: split-file %s %t | ||
// | ||
// RUN: %clang_cc1 -std=c++20 %t/foo.cppm -emit-module-interface -o %t/foo.pcm | ||
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=foo=%t/foo.pcm -verify -fsyntax-only | ||
|
||
//--- a.hpp | ||
#pragma once | ||
#define A 43 | ||
|
||
//--- foo.cppm | ||
module; | ||
#include "a.hpp" | ||
export module foo; | ||
export constexpr auto B = A; | ||
|
||
//--- use.cpp | ||
// expected-no-diagnostics | ||
import foo; | ||
#include "a.hpp" | ||
|
||
static_assert(A == 43); | ||
static_assert(B == 43); | ||
|