Skip to content

Commit 19e432e

Browse files
committed
Fix an assertion crash when substitute deduced tempalte arguments into
the deduction guide f. We tried to build a ConstantExpr on a ConstantExpr, which triggers the assertion in the ConstantExpr::Create method.
1 parent 6404a77 commit 19e432e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "llvm/ADT/SmallString.h"
4141
#include "llvm/ADT/SmallVector.h"
4242
#include "llvm/Support/Casting.h"
43+
#include "llvm/Support/Signals.h"
4344
#include <algorithm>
4445
#include <cstddef>
4546
#include <cstdlib>

clang/test/SemaCXX/cxx20-ctad-type-alias.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ template<int... C>
7171
using AF = Foo<1>;
7272
auto a = AF {};
7373
}
74+
75+
namespace test6 {
76+
template<typename T, bool B = false>
77+
struct Foo {
78+
Foo(T);
79+
};
80+
// non-type template argument.
81+
template<typename T>
82+
using AF = Foo<T, 1>;
83+
AF b{0};//
84+
}

0 commit comments

Comments
 (0)