File tree 3 files changed +52
-51
lines changed
3 files changed +52
-51
lines changed Original file line number Diff line number Diff line change @@ -1041,9 +1041,6 @@ Bug Fixes to C++ Support
1041
1041
in different visibility.
1042
1042
Fixes (`#67893 <https://github.com/llvm/llvm-project/issues/67893 >`_)
1043
1043
1044
- - Fix a false-positive ODR violation for different definitions for `std::align_val_t `.
1045
- Fixes (`#76638 <https://github.com/llvm/llvm-project/issues/76638 >`_)
1046
-
1047
1044
- Remove recorded `#pragma once ` state for headers included in named modules.
1048
1045
Fixes (`#77995 <https://github.com/llvm/llvm-project/issues/77995 >`_)
1049
1046
Original file line number Diff line number Diff line change @@ -745,55 +745,8 @@ void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
745
745
if (Enum->isScoped ())
746
746
AddBoolean (Enum->isScopedUsingClassTag ());
747
747
748
- if (Enum->getIntegerTypeSourceInfo ()) {
749
- // FIMXE: This allows two enums with different spellings to have the same
750
- // hash.
751
- //
752
- // // mod1.cppm
753
- // module;
754
- // extern "C" {
755
- // typedef unsigned __int64 size_t;
756
- // }
757
- // namespace std {
758
- // using :: size_t;
759
- // }
760
- //
761
- // extern "C++" {
762
- // namespace std {
763
- // enum class align_val_t : std::size_t {};
764
- // }
765
- // }
766
- //
767
- // export module mod1;
768
- // export using std::align_val_t;
769
- //
770
- // // mod2.cppm
771
- // module;
772
- // extern "C" {
773
- // typedef unsigned __int64 size_t;
774
- // }
775
- //
776
- // extern "C++" {
777
- // namespace std {
778
- // enum class align_val_t : size_t {};
779
- // }
780
- // }
781
- //
782
- // export module mod2;
783
- // import mod1;
784
- // export using std::align_val_t;
785
- //
786
- // The above example should be disallowed since it violates
787
- // [basic.def.odr]p14:
788
- //
789
- // Each such definition shall consist of the same sequence of tokens
790
- //
791
- // The definitions of `std::align_val_t` in two module units have different
792
- // spellings but we failed to give an error here.
793
- //
794
- // See https://github.com/llvm/llvm-project/issues/76638 for details.
748
+ if (Enum->getIntegerTypeSourceInfo ())
795
749
AddQualType (Enum->getIntegerType ().getCanonicalType ());
796
- }
797
750
798
751
// Filter out sub-Decls which will not be processed in order to get an
799
752
// accurate count of Decl's.
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
+ // RUN: %clang_cc1 -std=c++20 %t/mod1.cppm -emit-module-interface -o %t/mod1.pcm
6
+ // RUN: %clang_cc1 -std=c++20 %t/mod2.cppm -emit-module-interface -o %t/mod2.pcm
7
+ // RUN: %clang_cc1 -std=c++20 %t/test.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
8
+
9
+ // --- size_t.h
10
+
11
+ extern " C" {
12
+ typedef unsigned int size_t ;
13
+ }
14
+
15
+ // --- csize_t
16
+ namespace std {
17
+ using :: size_t ;
18
+ }
19
+
20
+ // --- align.h
21
+ namespace std {
22
+ enum class align_val_t : size_t {};
23
+ }
24
+
25
+ // --- mod1.cppm
26
+ module;
27
+ #include " size_t.h"
28
+ #include " align.h"
29
+ export module mod1;
30
+ namespace std {
31
+ export using std::align_val_t ;
32
+ }
33
+
34
+ // --- mod2.cppm
35
+ module;
36
+ #include " size_t.h"
37
+ #include " csize_t"
38
+ #include " align.h"
39
+ export module mod2;
40
+ namespace std {
41
+ export using std::align_val_t ;
42
+ }
43
+
44
+ // --- test.cpp
45
+ // expected-no-diagnostics
46
+ import mod1;
47
+ import mod2;
48
+ void test () {
49
+ std::align_val_t v;
50
+ }
51
+
You can’t perform that action at this time.
0 commit comments