Skip to content

Module STD : Can't use crtdbg header #4666

Description

@Cazayus

Describe the bug

It is currently impossible to use the crtdbg header with the std module
crtdbg.h is not a STL header, so it should not be affected by the current limitation of mixing import std and includes.

Command-line test case

C:\Temp>type repro.cpp
import std;
#include <crtdbg.h>

C:\Temp>cl.exe /std:c++latest /EHsc /nologo /c .\repro.cpp

C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\include\vcruntime_new.h(27): error C2011: 'std::align_val_t': 'unsigned enum' type redefinition
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\include\vcruntime_new.h(27): note: see declaration of 'std::align_val_t'

Expected behavior

It should compile but does not

STL version

    Microsoft Visual Studio Community 2022
    Version 17.10.0 Preview 7.0

Additional context

This bug looks similar on the surface (but is probably unrelated) to the mixing of std module and <intrin.h> (which has been fixed but not yet made available in previews of Visual Studio)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompilerCompiler work involvedmodulesC++23 modules, C++20 header units

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions