[libcxx-commits] [libcxx] a8f1a71 - [libc++] _Uglify some template parameter names. NFCI.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 14 07:32:36 PST 2022


Author: Arthur O'Dwyer
Date: 2022-01-14T10:32:04-05:00
New Revision: a8f1a715f00d251187a045ea0496d0efbdde7e7e

URL: https://github.com/llvm/llvm-project/commit/a8f1a715f00d251187a045ea0496d0efbdde7e7e
DIFF: https://github.com/llvm/llvm-project/commit/a8f1a715f00d251187a045ea0496d0efbdde7e7e.diff

LOG: [libc++] _Uglify some template parameter names. NFCI.

Added: 
    

Modified: 
    libcxx/include/numbers
    libcxx/include/optional
    libcxx/include/type_traits

Removed: 
    


################################################################################
diff  --git a/libcxx/include/numbers b/libcxx/include/numbers
index ede4e33c7a88..2ac36695b888 100644
--- a/libcxx/include/numbers
+++ b/libcxx/include/numbers
@@ -73,42 +73,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 namespace numbers {
 
-template <class T>
+template <class _Tp>
 inline constexpr bool __false = false;
 
-template <class T>
+template <class _Tp>
 struct __illformed
 {
-  static_assert(__false<T>, "A program that instantiates a primary template of a mathematical constant variable template is ill-formed.");
+  static_assert(__false<_Tp>, "A program that instantiates a primary template of a mathematical constant variable template is ill-formed.");
 };
 
-template <class T> inline constexpr T e_v =          __illformed<T>{};
-template <class T> inline constexpr T log2e_v =      __illformed<T>{};
-template <class T> inline constexpr T log10e_v =     __illformed<T>{};
-template <class T> inline constexpr T pi_v =         __illformed<T>{};
-template <class T> inline constexpr T inv_pi_v =     __illformed<T>{};
-template <class T> inline constexpr T inv_sqrtpi_v = __illformed<T>{};
-template <class T> inline constexpr T ln2_v =        __illformed<T>{};
-template <class T> inline constexpr T ln10_v =       __illformed<T>{};
-template <class T> inline constexpr T sqrt2_v =      __illformed<T>{};
-template <class T> inline constexpr T sqrt3_v =      __illformed<T>{};
-template <class T> inline constexpr T inv_sqrt3_v =  __illformed<T>{};
-template <class T> inline constexpr T egamma_v =     __illformed<T>{};
-template <class T> inline constexpr T phi_v =        __illformed<T>{};
-
-template <floating_point T> inline constexpr T e_v<T>          = 2.718281828459045235360287471352662;
-template <floating_point T> inline constexpr T log2e_v<T>      = 1.442695040888963407359924681001892;
-template <floating_point T> inline constexpr T log10e_v<T>     = 0.434294481903251827651128918916605;
-template <floating_point T> inline constexpr T pi_v<T>         = 3.141592653589793238462643383279502;
-template <floating_point T> inline constexpr T inv_pi_v<T>     = 0.318309886183790671537767526745028;
-template <floating_point T> inline constexpr T inv_sqrtpi_v<T> = 0.564189583547756286948079451560772;
-template <floating_point T> inline constexpr T ln2_v<T>        = 0.693147180559945309417232121458176;
-template <floating_point T> inline constexpr T ln10_v<T>       = 2.302585092994045684017991454684364;
-template <floating_point T> inline constexpr T sqrt2_v<T>      = 1.414213562373095048801688724209698;
-template <floating_point T> inline constexpr T sqrt3_v<T>      = 1.732050807568877293527446341505872;
-template <floating_point T> inline constexpr T inv_sqrt3_v<T>  = 0.577350269189625764509148780501957;
-template <floating_point T> inline constexpr T egamma_v<T>     = 0.577215664901532860606512090082402;
-template <floating_point T> inline constexpr T phi_v<T>        = 1.618033988749894848204586834365638;
+template <class _Tp> inline constexpr _Tp e_v =          __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp log2e_v =      __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp log10e_v =     __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp pi_v =         __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp inv_pi_v =     __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp inv_sqrtpi_v = __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp ln2_v =        __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp ln10_v =       __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp sqrt2_v =      __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp sqrt3_v =      __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp inv_sqrt3_v =  __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp egamma_v =     __illformed<_Tp>{};
+template <class _Tp> inline constexpr _Tp phi_v =        __illformed<_Tp>{};
+
+template <floating_point _Tp> inline constexpr _Tp e_v<_Tp>          = 2.718281828459045235360287471352662;
+template <floating_point _Tp> inline constexpr _Tp log2e_v<_Tp>      = 1.442695040888963407359924681001892;
+template <floating_point _Tp> inline constexpr _Tp log10e_v<_Tp>     = 0.434294481903251827651128918916605;
+template <floating_point _Tp> inline constexpr _Tp pi_v<_Tp>         = 3.141592653589793238462643383279502;
+template <floating_point _Tp> inline constexpr _Tp inv_pi_v<_Tp>     = 0.318309886183790671537767526745028;
+template <floating_point _Tp> inline constexpr _Tp inv_sqrtpi_v<_Tp> = 0.564189583547756286948079451560772;
+template <floating_point _Tp> inline constexpr _Tp ln2_v<_Tp>        = 0.693147180559945309417232121458176;
+template <floating_point _Tp> inline constexpr _Tp ln10_v<_Tp>       = 2.302585092994045684017991454684364;
+template <floating_point _Tp> inline constexpr _Tp sqrt2_v<_Tp>      = 1.414213562373095048801688724209698;
+template <floating_point _Tp> inline constexpr _Tp sqrt3_v<_Tp>      = 1.732050807568877293527446341505872;
+template <floating_point _Tp> inline constexpr _Tp inv_sqrt3_v<_Tp>  = 0.577350269189625764509148780501957;
+template <floating_point _Tp> inline constexpr _Tp egamma_v<_Tp>     = 0.577215664901532860606512090082402;
+template <floating_point _Tp> inline constexpr _Tp phi_v<_Tp>        = 1.618033988749894848204586834365638;
 
 inline constexpr double e          = e_v<double>;
 inline constexpr double log2e      = log2e_v<double>;

diff  --git a/libcxx/include/optional b/libcxx/include/optional
index 63753d9f9f03..917e9b5cdb57 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -1167,8 +1167,8 @@ public:
 };
 
 #if _LIBCPP_STD_VER >= 17
-template<class T>
-    optional(T) -> optional<T>;
+template<class _Tp>
+    optional(_Tp) -> optional<_Tp>;
 #endif
 
 // Comparisons between optionals

diff  --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 155b775e4929..b4010851f133 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -2318,7 +2318,7 @@ struct __common_type_impl {};
 // Clang provides variadic templates in C++03 as an extension.
 #if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__)
 # define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__
-template <class... Tp>
+template <class... _Tp>
 struct __common_types;
 template <class... _Tp>
 struct _LIBCPP_TEMPLATE_VIS common_type;


        


More information about the libcxx-commits mailing list