[clang] [llvm] [HLSL] Implement '__builtin_hlsl_is_intangible' type trait (PR #104544)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 13:03:33 PDT 2024


================
@@ -5683,6 +5685,14 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT,
         return true;
     return false;
   }
+  case UTT_IsIntangibleType:
+    if (!T->isVoidType() && !T->isIncompleteArrayType())
+      if (Self.RequireCompleteType(TInfo->getTypeLoc().getBeginLoc(), T,
+                                   diag::err_incomplete_type))
+        return false;
+    DiagnoseVLAInCXXTypeTrait(Self, TInfo,
+                              tok::kw___builtin_hlsl_is_intangible);
+    return Self.HLSL().IsIntangibleType(T);
----------------
hekota wrote:

These are existing functions for diagnosing uncomplete types and variable length arrays and it is tested in `IsIntangibleTypeErrors.hlsl`. I used the same checks as in PR #102227.

https://github.com/llvm/llvm-project/pull/104544


More information about the cfe-commits mailing list