It crashes on 14, but not on 13
This is fixed by upstream commit https://github.com/llvm/llvm-project/commit/79f9cfbc21e02555258523ea77c3dd389891cfb3, which I will merge into main (which has clang 12.0.1) and MFC back to stable/13 and optionally stable/{11,12}.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=efa485d5c390b745f53761da9159721243c48b7b commit efa485d5c390b745f53761da9159721243c48b7b Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-21 21:03:37 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-21 21:03:50 +0000 Apply clang fix for assertion failure compiling multimedia/minitube Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu): Do not merge LocalInstantiationScope for template specialization A lambda in a function template may be recursively instantiated. The recursive lambda will cause a lambda function instantiated multiple times, one inside another. The inner LocalInstantiationScope should not be marked as MergeWithParentScope since it already has references to locals properly substituted, otherwise it causes assertion due to the check for duplicate locals in merged LocalInstantiationScope. Reviewed by: Richard Smith Differential Revision: https://reviews.llvm.org/D98068 Reported by: yuri PR: 257978 MFC after: 3 days .../llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5e9c2a6a902346a6d7d29bc8c81f0b3fcccaa57f commit 5e9c2a6a902346a6d7d29bc8c81f0b3fcccaa57f Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-21 21:03:37 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-26 18:05:27 +0000 Apply clang fix for assertion failure compiling multimedia/minitube Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu): Do not merge LocalInstantiationScope for template specialization A lambda in a function template may be recursively instantiated. The recursive lambda will cause a lambda function instantiated multiple times, one inside another. The inner LocalInstantiationScope should not be marked as MergeWithParentScope since it already has references to locals properly substituted, otherwise it causes assertion due to the check for duplicate locals in merged LocalInstantiationScope. Reviewed by: Richard Smith Differential Revision: https://reviews.llvm.org/D98068 Reported by: yuri PR: 257978 (cherry picked from commit efa485d5c390b745f53761da9159721243c48b7b) .../llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d2f810f8a9a21282803bf886705656f1af26c3 commit d7d2f810f8a9a21282803bf886705656f1af26c3 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-21 21:03:37 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-26 18:05:13 +0000 Apply clang fix for assertion failure compiling multimedia/minitube Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu): Do not merge LocalInstantiationScope for template specialization A lambda in a function template may be recursively instantiated. The recursive lambda will cause a lambda function instantiated multiple times, one inside another. The inner LocalInstantiationScope should not be marked as MergeWithParentScope since it already has references to locals properly substituted, otherwise it causes assertion due to the check for duplicate locals in merged LocalInstantiationScope. Reviewed by: Richard Smith Differential Revision: https://reviews.llvm.org/D98068 Reported by: yuri PR: 257978 (cherry picked from commit efa485d5c390b745f53761da9159721243c48b7b) .../llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
A commit in branch stable/11 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9e1de6e8250355cda0615332d43bbba61d4d873f commit 9e1de6e8250355cda0615332d43bbba61d4d873f Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-08-21 21:03:37 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-08-26 18:05:01 +0000 Apply clang fix for assertion failure compiling multimedia/minitube Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu): Do not merge LocalInstantiationScope for template specialization A lambda in a function template may be recursively instantiated. The recursive lambda will cause a lambda function instantiated multiple times, one inside another. The inner LocalInstantiationScope should not be marked as MergeWithParentScope since it already has references to locals properly substituted, otherwise it causes assertion due to the check for duplicate locals in merged LocalInstantiationScope. Reviewed by: Richard Smith Differential Revision: https://reviews.llvm.org/D98068 Reported by: yuri PR: 257978 (cherry picked from commit efa485d5c390b745f53761da9159721243c48b7b) .../llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)