LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 47261 - <version> header is missing __cpp_lib_type_identity and other macros
Summary: <version> header is missing __cpp_lib_type_identity and other macros
Status: NEW
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: 11.0
Hardware: PC Linux
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-20 16:20 PDT by Marcel Ehrhardt
Modified: 2020-08-21 01:54 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Ehrhardt 2020-08-20 16:20:38 PDT
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.

```c++
#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!
Comment 1 Marcel Ehrhardt 2020-08-21 01:54:20 PDT
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:

```c++
#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.