Skip to content
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

<version> header is missing __cpp_lib_type_identity and other macros #46605

Closed
marehr opened this issue Aug 20, 2020 · 2 comments
Closed

<version> header is missing __cpp_lib_type_identity and other macros #46605

marehr opened this issue Aug 20, 2020 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@marehr
Copy link

marehr commented Aug 20, 2020

Bugzilla Link 47261
Version 11.0
OS Linux
CC @mclow

Extended Description

Hi clang-team,

the following code doesn't compile, even thought it can compile std::type_identity and std::unwrap_reference just fine since clang 9.0.0.

#include <type_traits>

using a = std::type_identity<int>; // works fine
using b = std::unwrap_reference_t<int>; // works fine

#ifndef __cpp_lib_type_identity
#error "Not defined?"
#endif

#ifndef __cpp_lib_unwrap_ref
#error "Not defined?"
#endif

https://godbolt.org/z/6vaa6x

I thought https://eel.is/c++draft/version.syn suggests that __cpp_lib_type_identity should be defined if it was implemented.

Thank you!

@marehr
Copy link
Author

marehr commented Aug 21, 2020

Oops, in the haste of writing this ticket, I forgot to add -stdlib=libc++ in the compiler explorer. That means unwrap_reference_t is not implemented yet, and thus it is correct that it does not define the macro.

I should have stuck to my original observed problem:

#include <type_traits>

using a = std::type_identity<int>;

#ifndef __cpp_lib_type_identity
#error "Not defined?"
#endif

https://godbolt.org/z/KdWEfK

does not compile.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Quuxplusone Quuxplusone self-assigned this Dec 31, 2021
@Quuxplusone
Copy link
Contributor

This is now https://reviews.llvm.org/D116433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

2 participants