[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 03:03:27 PDT 2024


================
@@ -932,6 +932,10 @@ bool Sema::LookupBuiltin(LookupResult &R) {
           R.addDecl(getASTContext().getTypePackElementDecl());
           return true;
         }
+        if (II == getASTContext().getCommonTypeName()) {
+          R.addDecl(getASTContext().getCommonTypeDecl());
+          return true;
+        }
----------------
Sirraide wrote:

This part here is a bit confusing to look at because there’s an `else if` on the previous one, but you didn’t use one here. Of course, the `else` is unnecessary because we return in the `if` statement anyway, so I’d just remove the `else` from the `else if` here to make this a bit easier to read.

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


More information about the cfe-commits mailing list