Skip to content

[Clang-CL] source_location is not available in clang-cl tool with /std:c++20 #60347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danakj opened this issue Jan 28, 2023 · 3 comments
Closed
Labels
c++20 clang-cl `clang-cl` driver. Don't use for other compiler parts consteval C++20 consteval duplicate Resolved as duplicate

Comments

@danakj
Copy link
Contributor

danakj commented Jan 28, 2023

A clang tool on Windows uses clang-cl, which uses the MSVC library, and the <source_location> header contains this:

#pragma once
#ifndef _SOURCE_LOCATION_
#define _SOURCE_LOCATION_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_consteval
_EMIT_STL_WARNING(STL4038, "The contents of <source_location> are available only with C++20 consteval support.");
#else // ^^^ !defined(__cpp_consteval) / defined(__cpp_consteval) vvv

If I pass /D__cpp_consteval then source_location is there. As consteval is supported in Clang with C++20, should clang-cl tooling automatically set this define?

This is possibly related to #59689 where _CRT_USE_BUILTIN_OFFSETOF is not defined in a clang-cl tool.

@danakj danakj changed the title [Clang-CL] source_location is not available in clang-cl /std:c++20 [Clang-CL] source_location is not available in clang-cl tool with /std:c++20 Jan 28, 2023
@EugeneZelenko EugeneZelenko added clang-cl `clang-cl` driver. Don't use for other compiler parts and removed new issue labels Jan 28, 2023
@alvinhochun
Copy link
Contributor

Related to #57094

@alvinhochun alvinhochun added c++20 consteval C++20 consteval labels Feb 19, 2023
@llvmbot
Copy link
Member

llvmbot commented Feb 19, 2023

@llvm/issue-subscribers-c-20

@AaronBallman AaronBallman added the duplicate Resolved as duplicate label Feb 22, 2023
@AaronBallman
Copy link
Collaborator

Duplicate of #57094

@AaronBallman AaronBallman marked this as a duplicate of #57094 Feb 22, 2023
@AaronBallman AaronBallman closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang-cl `clang-cl` driver. Don't use for other compiler parts consteval C++20 consteval duplicate Resolved as duplicate
Projects
Status: No status
Development

No branches or pull requests

5 participants