[clang] f539b6f - [NFC] Add tests from my fix for GH62362.

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 27 06:33:40 PDT 2023


Author: Erich Keane
Date: 2023-04-27T06:33:34-07:00
New Revision: f539b6ffc25144703498176558035c499825dc48

URL: https://github.com/llvm/llvm-project/commit/f539b6ffc25144703498176558035c499825dc48
DIFF: https://github.com/llvm/llvm-project/commit/f539b6ffc25144703498176558035c499825dc48.diff

LOG: [NFC] Add tests from my fix for GH62362.

This ended up being fixed separately by @rsmith in 1e43349e3 in a
better/correct way. This patch adds the tests from the original, as
though they are reasonably covered in his patch, explicit versions seem
to have value here.

Additionally, this adds a release note for 1e43349e3.

Added: 
    

Modified: 
    clang/docs/ReleaseNotes.rst
    clang/test/SemaTemplate/concepts-inherited-ctor.cpp

Removed: 
    


################################################################################
diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index f473f97f6c74..26fdffe920e9 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -327,6 +327,10 @@ Bug Fixes in This Version
   (`#62122 <https://github.com/llvm/llvm-project/issues/62122>`_)
 - Fix crash when handling undefined template partial specialization
   (`#61356 <https://github.com/llvm/llvm-project/issues/61356>`_)
+- Fix a crash caused by incorrectly evaluating constraints on an inheriting
+  constructor declaration.
+  (`#62361 <https://github.com/llvm/llvm-project/issues/62361>`_)
+  (`#62362 <https://github.com/llvm/llvm-project/issues/62362>`_)
 
 Bug Fixes to Compiler Builtins
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

diff  --git a/clang/test/SemaTemplate/concepts-inherited-ctor.cpp b/clang/test/SemaTemplate/concepts-inherited-ctor.cpp
index f50a6aebeeab..d6f3546b25fb 100644
--- a/clang/test/SemaTemplate/concepts-inherited-ctor.cpp
+++ b/clang/test/SemaTemplate/concepts-inherited-ctor.cpp
@@ -68,3 +68,25 @@ namespace no_early_substitution {
     C();
   }
 }
+
+namespace GH62362 {
+  template<typename T>
+    concept C = true;
+  template <typename T> struct Test {
+    Test()
+      requires(C<T>);
+  };
+  struct Bar : public Test<int> {
+    using Test<int>::Test;
+  };
+  template <>
+    struct Test<void> : public Test<int> {
+      using Test<int>::Test;
+    };
+
+  void foo() {
+    Bar();
+    Test<void>();
+  }
+}
+}


        


More information about the cfe-commits mailing list