-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constevalC++20 constevalC++20 constevalenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature
Description
GCC allows to evaluate all math built-ins in a constexpr context. libstdc++ even provides extended constexpr math functions, like constexpr std::sin. That library extension is in violation of the C++ standard but libstdc++ developers decided to keep it nevertheless.
The feature is especially useful in embedded code bases for small devices to do complex pre-computations at compile-time.
Could it be acceptable to make most math built-ins available from a constexpr context in Clang? The change should not cause any non-conformities since functions in libc++ are still not constexpr. Users who heavily rely on the constexpr behaviour could define their own functions using the built-ins and more easily migrate from GCC to Clang.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constevalC++20 constevalC++20 constevalenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature
Type
Projects
Status
No status