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

Clang C++20 Feature: P0732R2 - Class Types in Non-Type Template Parameters #54297

Closed
JVApen opened this issue Mar 9, 2022 · 7 comments
Closed
Labels

Comments

@JVApen
Copy link

JVApen commented Mar 9, 2022

id: P0732R2
paper: https://wg21.link/p0732r2
partially implemented: status unknown

@llvmbot
Copy link
Member

llvmbot commented Mar 9, 2022

@llvm/issue-subscribers-c-20

@trueqbit
Copy link

I'd like to know the status of this feature.
cppreference's compiler support matrix lists "Class types in non-type template parameters" as partially implemented in clang 12. What does this mean exactly?

__cpp_nontype_template_args is still at version 201411L, however the 'string literal operator template' and constant evaluation of string literals works perfectly, see example on godbolt.

The reason I ask is that I am implementing a feature in the sqlite_orm library that relies heavily on "compile time" strings as template parameters.

@bolshakov-a
Copy link
Contributor

I think it is fully implemented (in Clang 12) except some issues with MSVC compatibility (see https://reviews.llvm.org/D146386). Clang C++ status table has just a common cell for it and P1907R1. Even P1907R1 was almost fully implemented back in 2021 but reverted.

@nitnelave
Copy link

It doesn't seem quite fully implemented, for instance it's missing floats: https://godbolt.org/z/aa8n5qPYs

@bolshakov-a
Copy link
Contributor

No, it's another feature: P1907R1.

@cs96and
Copy link

cs96and commented Jan 15, 2024

Seems that member functions of a class-type variadic class template must currently be declared inline. Moving them out of the function definition throws an error

nested name specifier 'Two<m...>::' for declaration does not refer into a class, class template or class template partial specialization

https://godbolt.org/z/o6aG4TT1P

@JVApen
Copy link
Author

JVApen commented Jul 23, 2024

Status page indicates this is available from LLVM 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

8 participants