Chuanqi Xu 24c06a19be [C++20] [Modules] handling selectAny attribute for vardecl
Close https://github.com/llvm/llvm-project/issues/127963

The root cause of the problem seems to be that we didn't realize it
simply.
2025-02-21 10:48:30 +08:00

32 lines
559 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/repro.cppm -fdeclspec -emit-module-interface -o %t/repro.pcm
// RUN: %clang_cc1 -std=c++20 %t/source.cpp -fdeclspec -fsyntax-only -verify -fprebuilt-module-path=%t
//--- repro_decl.hpp
#pragma once
extern "C"
{
__declspec(selectany) int foo = 0;
}
//--- repro.cppm
module;
#include "repro_decl.hpp"
export module repro;
export inline int func()
{
return foo;
}
//--- source.cpp
// expected-no-diagnostics
import repro;
#include "repro_decl.hpp"