Timm =?utf-8?q?B=C3=A4der?= <[email protected]>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67147/[email protected]>
================
@@ -31,6 +31,28 @@ static_assert(b, "");
constexpr int one = true;
static_assert(one == 1, "");
+constexpr bool b2 = bool();
+static_assert(!b2, "");
+
+namespace ScalarTypes {
+ constexpr int ScalarInitInt = int();
+ static_assert(ScalarInitInt == 0, "");
+ constexpr float ScalarInitFloat = float();
+ static_assert(ScalarInitFloat == 0.0f, "");
+
+ static_assert(decltype(nullptr)() == nullptr, "");
+
+ template<typename T>
+ constexpr T getScalar() { return T(); }
+
+ static_assert(getScalar<const int>() == 0, "");
+ static_assert(getScalar<const double>() == 0.0, "");
+
+ static_assert(getScalar<void*>() == nullptr, "");
+ static_assert(getScalar<void(*)(void)>() == nullptr, "");
+ /// FIXME: Member pointers.
----------------
shafik wrote:
and enumeration types
https://github.com/llvm/llvm-project/pull/67147
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits