File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,10 @@ Bug Fixes to C++ Support
383
383
- Fixed a bug causing destructors of constant-evaluated structured bindings
384
384
initialized by array elements to be called in the wrong evaluation context.
385
385
386
+ - Fix crash where ill-formed code was being treated as a deduction guide and
387
+ we now produce a diagnostic. Fixes:
388
+ (`#65522 <https://github.com/llvm/llvm-project/issues/65522 >`_)
389
+
386
390
Bug Fixes to AST Handling
387
391
^^^^^^^^^^^^^^^^^^^^^^^^^
388
392
- Fixed an import failure of recursive friend class template.
Original file line number Diff line number Diff line change @@ -5416,6 +5416,8 @@ def note_constraint_normalization_here : Note<
5416
5416
def note_parameter_mapping_substitution_here : Note<
5417
5417
"while substituting into concept arguments here; substitution failures not "
5418
5418
"allowed in concept arguments">;
5419
+ def note_building_deduction_guide_here : Note<
5420
+ "while building implicit deduction guide first needed here">;
5419
5421
def note_lambda_substitution_here : Note<
5420
5422
"while substituting into a lambda expression here">;
5421
5423
def note_instantiation_contexts_suppressed : Note<
Original file line number Diff line number Diff line change @@ -1075,7 +1075,9 @@ void Sema::PrintInstantiationStack() {
1075
1075
<< Active->InstantiationRange ;
1076
1076
break ;
1077
1077
case CodeSynthesisContext::BuildingDeductionGuides:
1078
- llvm_unreachable (" unexpected deduction guide in instantiation stack" );
1078
+ Diags.Report (Active->PointOfInstantiation ,
1079
+ diag::note_building_deduction_guide_here);
1080
+ break ;
1079
1081
}
1080
1082
}
1081
1083
}
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -std=c++20 -Wc++17-compat -verify -Wno-unused %s
2
+
3
+ class X {};
4
+
5
+ template <typename T>
6
+ class B3 { // expected-note {{candidate template ignored: could not match 'B3<T>' against 'int'}}
7
+ template <X x> B3 (T); // expected-warning 2{{non-type template parameter of type 'X' is incompatible with C++ standards before C++20}} \
8
+ // expected-note {{candidate template ignored: couldn't infer template argument 'x'}}
9
+ };
10
+ B3 b3 = 0 ; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'B3'}} \
11
+ // expected-note {{while building implicit deduction guide first needed here}}
You can’t perform that action at this time.
0 commit comments