Commit 8eaa05d 1 parent 97795be commit 8eaa05d Copy full SHA for 8eaa05d
File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -4346,7 +4346,7 @@ Sema::TemplateDeductionResult Sema::DeduceTemplateArguments(
4346
4346
HasDeducedReturnType = true ;
4347
4347
}
4348
4348
4349
- if (!ArgFunctionType.isNull ()) {
4349
+ if (!ArgFunctionType.isNull () && !FunctionType. isNull () ) {
4350
4350
unsigned TDF =
4351
4351
TDF_TopLevelParameterTypeList | TDF_AllowCompatibleFunctionType;
4352
4352
// Deduce template arguments from the function type.
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
2
+
3
+ // Ensure that we don't crash if errors are suppressed by an error limit.
4
+ // RUN: not %clang_cc1 -fsyntax-only -std=c++17 -ferror-limit 1 %s
5
+
6
+ template <bool is_const, typename tag_t = void >
7
+ struct tv_val {
8
+ };
9
+
10
+ template <bool is_const>
11
+ auto &val (const tv_val<is_const> &val) { return val.val (); } // expected-note {{possible target for call}}
12
+
13
+ struct Class {
14
+ template <bool is_const>
15
+ struct Entry {
16
+ tv_val<is_const> val;
17
+ };
18
+ };
19
+
20
+ enum Types : int {
21
+ Class = 1 , // expected-note 2 {{struct 'Class' is hidden}}
22
+ };
23
+
24
+ struct Record {
25
+ Class *val_; // expected-error {{must use 'struct' tag}}
26
+ void setClass (Class *); // expected-error {{must use 'struct' tag}}
27
+ };
28
+
29
+ void Record::setClass (Class *val) { // expected-error {{variable has incomplete type 'void'}} \
30
+ // expected-error {{reference to overloaded function}} \
31
+ // expected-error {{expected ';' after top level declarator}}
32
+ val_ = val;
33
+ }
You can’t perform that action at this time.
0 commit comments