llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>



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


2 Files Affected:

- (modified) clang/lib/AST/ByteCode/Compiler.cpp (+2-1) 
- (modified) clang/test/AST/ByteCode/invalid.cpp (+14) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index a50980d23d3b2..908e9a81c19ca 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4140,7 +4140,8 @@ bool Compiler<Emitter>::VisitCXXInheritedCtorInitExpr(
   assert(!Ctor->isTrivial() &&
          "Trivial CXXInheritedCtorInitExpr, implement. (possible?)");
   const Function *F = this->getFunction(Ctor);
-  assert(F);
+  if (!F)
+    return false;
   assert(!F->hasRVO());
   assert(F->hasThisPointer());
 
diff --git a/clang/test/AST/ByteCode/invalid.cpp 
b/clang/test/AST/ByteCode/invalid.cpp
index 930565181b202..0e6d2d4b508b8 100644
--- a/clang/test/AST/ByteCode/invalid.cpp
+++ b/clang/test/AST/ByteCode/invalid.cpp
@@ -227,3 +227,17 @@ namespace DefinitionInBody {
     return 5;
   }
 }
+
+namespace InheritedCtor {
+  struct S {
+    constexpr S(int = ; // both-note {{to match this}} \
+                        // both-error {{expected ';' at end of declaration 
list}} \
+                        // both-error {{expected expression}}
+  }; // both-error {{expected ')'}}
+
+  struct SS : S {
+    using S::S;
+  };
+
+  SS ss{42};
+}

``````````

</details>


https://github.com/llvm/llvm-project/pull/209138
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to