This paper has been applied to the working draft and is believed to be a DR against C++20, so that the patch here makes the change unconditionally. for: ``` export module A; const int mod_cst = 10; ``` Before the change, mod_cst would have internal linkage; after the change it has module linkage. Differential Revision: https://reviews.llvm.org/D145886
12 lines
353 B
C++
12 lines
353 B
C++
// RUN: %clang_cc1 -std=c++20 -triple x86_64-linux %s -emit-module-interface -o %t
|
|
// RUN: %clang_cc1 -std=c++20 -triple x86_64-linux -x pcm %t -emit-llvm -o - | FileCheck %s
|
|
|
|
export module M;
|
|
|
|
// CHECK: @_ZW1M1a ={{.*}} constant i32 1
|
|
const int a = 1;
|
|
// CHECK: @_ZW1M1b ={{.*}} constant i32 2
|
|
export const int b = 2;
|
|
|
|
export int f() { return a + b; }
|