Open
Description
Description
When a constexpr
is declared inside a namespace, it won't be visible from Swift; but declaring it in the global namespace will make it visible in Swift.
Reproduction
In a cpp target:
namespace namespace_test{
constexpr int TEST1 = 44;
static constexpr char TEST2 = 't';
}
constexpr int TEST1 = 44;
static constexpr char TEST2= 't';
And then in swift
import cxx_target
let i = TEST1
let i2 - namespace_test.TEST1
let c = TEST2
let c2 = namespace_test.TEST2
which will result in "error: type 'namespace_test' has no member 'TEST1'" and "error: type 'namespace_test' has no member 'TEST2'"
Expected behavior
The constexpr
s are available in Swift.
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Additional information
No response