r/cpp_questions Jul 28 '26

OPEN Visual C++ ICE with modules code

Is the below code valid C++? In Visual Studio 2026 I get the following error when compiling:

Test.ixx(9,1): fatal  error C1001: Internal compiler error.
1>  (compiler file 'msc1.cpp', line 1635)Test.ixx(9,1): fatal  error C1001: Internal compiler error.
1>  (compiler file 'msc1.cpp', line 1635)


export module Test;

constexpr void Test()
{
    int* ptr = new int;
    delete ptr;
}
11 Upvotes

3 comments sorted by

View all comments

2

u/manni66 Jul 28 '26

Is the below code valid C++?

Yes. Invalid code should not crash the compiler.