This happens when exporting a module namespace variable. It compiles and works as intended but Intellisense seems disagree. Is it an intellisense bug or a undefined behavior that has side effects?
Tried Unnamed/anonymous namespaces vs. static functions but still same error.
Env: windows11 VS2022 ISO C++latest with Experimetal Module on.
employee.ixx
export module employee;
import std.core;
namespace Records {
//raise E3309
export const int DefaultRaiseAndDemeritAmount{ 1'000 };
}
main.cpp
import std.core;
import employee;
using namespace std;
int main()
{
auto RaiseModifier = Records::DefaultRaiseAndDemeritAmount;
//compiler no error and work as intended, print 1000 to console.
cout << RaiseModifier;
}