Skip to content

Conversation

@tbaederr
Copy link
Contributor

And return true. Also make those two functions const.

And return true. Also make those two functions const.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:bytecode Issues for the clang bytecode constexpr interpreter labels Nov 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2025

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

And return true. Also make those two functions const.


Full diff: https://github.com/llvm/llvm-project/pull/168069.diff

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/Context.h (+4-2)
diff --git a/clang/lib/AST/ByteCode/Context.h b/clang/lib/AST/ByteCode/Context.h
index f5fa977cbcad8..a21bb3ed8fbe7 100644
--- a/clang/lib/AST/ByteCode/Context.h
+++ b/clang/lib/AST/ByteCode/Context.h
@@ -98,20 +98,22 @@ class Context final {
     return classify(E->getType());
   }
 
-  bool canClassify(QualType T) {
+  bool canClassify(QualType T) const {
     if (const auto *BT = dyn_cast<BuiltinType>(T)) {
       if (BT->isInteger() || BT->isFloatingPoint())
         return true;
       if (BT->getKind() == BuiltinType::Bool)
         return true;
     }
+    if (T->isPointerOrReferenceType())
+      return true;
 
     if (T->isArrayType() || T->isRecordType() || T->isAnyComplexType() ||
         T->isVectorType())
       return false;
     return classify(T) != std::nullopt;
   }
-  bool canClassify(const Expr *E) {
+  bool canClassify(const Expr *E) const {
     if (E->isGLValue())
       return true;
     return canClassify(E->getType());

@tbaederr tbaederr merged commit 94c751d into llvm:main Nov 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bytecode Issues for the clang bytecode constexpr interpreter clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants