Alejandro Álvarez Ayllón
0dd56858fe
[clang][Sema] Fix assertion in tryDiagnoseOverloadedCast
( #108021 )
...
Fixed an assertion failure in debug mode, and potential crashes in
release mode, when
diagnosing a failed cast caused indirectly by a failed implicit
conversion to the type of the constructor parameter.
For instance
```
template<typename>
struct StringTrait {};
template< int N >
struct StringTrait< const char[ N ] > {
typedef char CharType;
static const MissingIntT length = N - 1;
};
class String {
public:
template <typename T>
String(T& str, typename StringTrait<T>::CharType = 0);
};
class Exception {
public:
Exception(String const&);
};
void foo() {
throw Exception("some error");
}
```
`Exception(String const&)` is a matching constructor for `Exception`
from a `const char*`, via an implicit conversion to `String`. However,
the instantiation of the `String` constructor will fail because of the
missing type `MissingIntT` inside the specialization of `StringTrait`.
When trying to emit a diagnosis, `tryDiagnoseOverloadedCast` expects not
to have a matching constructor, but there is; it just could not be
instantiated.
2024-09-18 10:11:03 +02:00
..
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2024-05-21 15:01:13 -04:00
2023-02-16 17:58:35 -08:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-06-15 11:58:26 +02:00
2022-02-07 15:29:36 -05:00
2023-08-30 11:46:54 +03:00
2024-05-19 10:46:12 -07:00
2023-08-30 11:46:54 +03:00
2024-08-15 14:42:39 -04:00
2023-08-28 12:13:42 -04:00
2022-05-04 08:35:47 -04:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2023-06-05 14:56:58 +02:00
2023-06-05 14:56:58 +02:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2023-11-07 08:27:41 -05:00
2024-02-15 07:58:01 -05:00
2024-01-15 09:41:32 +00:00
2024-01-15 09:41:32 +00:00
2023-08-15 14:13:13 +02:00
2023-07-22 09:34:15 -07:00
2023-10-05 12:16:00 -04:00
2023-08-11 08:42:01 -04:00
2023-08-11 08:42:01 -04:00
2024-04-03 18:39:53 +02:00
2022-09-28 13:27:52 -04:00
2024-02-16 15:08:04 -05:00
2022-07-29 13:18:44 -04:00
2024-03-06 09:46:35 +01:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-05-04 08:35:47 -04:00
2024-07-01 17:43:07 +02:00
2022-02-07 15:29:36 -05:00
2024-01-27 10:23:38 +01:00
2023-11-07 08:27:41 -05:00
2024-02-13 14:25:56 -05:00
2023-06-07 10:31:11 +02:00
2024-01-15 09:41:32 +00:00
2024-03-21 12:57:24 +01:00
2023-08-22 18:10:41 -07:00
2024-09-12 16:36:06 +08:00
2023-05-04 19:19:52 +02:00
2024-04-28 20:25:44 +02:00
2022-08-04 17:08:08 -07:00
2022-09-04 05:29:32 +00:00
2023-08-08 08:00:02 +05:30
2024-07-15 13:22:40 +02:00
2024-04-23 20:34:22 +08:00
2022-03-23 22:30:45 +01:00
2023-04-10 17:33:09 +02:00
2023-08-29 11:28:57 -07:00
2023-05-20 13:22:58 +02:00
2023-05-04 19:19:52 +02:00
2023-05-04 19:19:52 +02:00
2023-05-04 19:19:52 +02:00
2024-03-21 12:57:24 +01:00
2023-05-04 19:19:52 +02:00
2024-04-14 12:30:01 +02:00
2024-01-27 10:23:38 +01:00
2024-08-15 21:16:30 +02:00
2024-08-15 21:16:30 +02:00
2024-03-21 12:57:24 +01:00
2023-07-03 06:07:04 -04:00
2024-09-05 17:38:08 +02:00
2023-02-23 14:40:58 +08:00
2022-09-28 08:50:27 -07:00
2024-03-09 12:07:16 +01:00
2024-05-21 15:01:13 -04:00
2023-05-20 13:22:58 +02:00
2023-08-15 14:13:13 +02:00
2024-09-18 10:11:03 +02:00
2022-09-04 05:29:32 +00:00
2024-04-11 11:23:24 -04:00
2022-08-30 15:11:38 +02:00
2022-05-04 08:35:47 -04:00
2024-07-12 13:12:14 +02:00
2024-02-13 14:25:56 -05:00
2024-03-04 09:25:29 -08:00
2023-08-28 12:13:42 -04:00
2024-01-04 21:04:54 +01:00
2022-05-04 08:35:47 -04:00
2023-08-28 12:13:42 -04:00
2023-04-25 23:08:30 +02:00
2023-02-16 14:05:16 +08:00
2023-05-15 07:39:58 -04:00
2024-07-13 08:53:02 +02:00
2024-07-23 13:31:49 +02:00
2023-05-15 07:39:58 -04:00
2024-05-29 17:02:15 -03:00
2023-08-28 12:13:42 -04:00
2023-01-18 12:41:44 +01:00
2022-02-07 15:29:36 -05:00
2023-08-28 12:13:42 -04:00
2024-05-28 14:55:18 -04:00
2022-05-04 08:35:47 -04:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2022-05-04 08:35:47 -04:00
2022-02-07 15:29:36 -05:00
2024-05-04 23:08:11 -07:00
2022-10-14 10:55:29 -04:00
2024-08-22 23:33:40 +02:00
2024-08-21 17:38:24 +04:00
2022-02-07 15:29:36 -05:00
2024-07-02 08:19:07 -04:00
2023-06-05 11:35:03 -04:00
2024-01-10 08:49:36 +08:00
2024-01-10 08:49:36 +08:00
2023-09-19 04:02:04 +02:00
2023-09-12 11:06:06 -07:00
2023-08-28 12:13:42 -04:00
2022-07-22 15:24:54 -04:00
2022-04-08 16:19:58 -04:00
2022-11-04 07:33:31 +00:00
2024-05-21 15:14:03 -04:00
2023-08-28 12:13:42 -04:00
2022-09-16 19:39:48 +00:00
2024-05-27 15:58:58 +02:00
2023-08-28 12:13:42 -04:00
2023-08-03 12:58:48 +08:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-03 12:58:48 +08:00
2023-08-28 12:13:42 -04:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2022-10-10 15:45:02 -04:00
2022-02-07 15:29:36 -05:00
2023-08-30 11:46:54 +03:00
2024-07-26 08:39:46 -04:00
2022-02-09 09:11:49 -05:00
2022-03-15 22:30:22 +03:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2024-05-03 10:23:53 -07:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2023-08-18 16:27:57 +02:00
2023-08-28 12:13:42 -04:00
2022-05-04 08:35:47 -04:00
2023-06-07 10:31:11 +02:00
2022-03-14 21:45:31 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2022-07-25 07:22:54 -04:00
2022-08-11 08:44:38 +02:00
2022-02-09 09:11:49 -05:00
2022-02-09 09:11:49 -05:00
2024-05-23 14:50:29 -04:00
2023-10-20 13:10:03 -04:00
2023-08-28 12:13:42 -04:00
2024-03-21 12:57:24 +01:00
2022-03-31 13:45:39 -04:00
2022-10-20 09:29:09 -07:00
2022-05-13 08:31:52 -04:00
2022-06-15 10:54:46 +01:00
2024-08-23 09:49:08 -04:00
2022-02-09 09:11:49 -05:00
2022-03-18 12:20:41 +00:00
2024-05-23 14:50:29 -04:00
2022-02-09 09:11:49 -05:00
2023-09-27 18:58:01 +02:00
2023-11-28 23:38:50 +09:00
2022-11-21 16:02:54 +00:00
2023-11-28 23:38:50 +09:00
2023-10-20 13:10:03 -04:00
2024-04-29 22:00:41 +08:00
2023-08-28 12:13:42 -04:00
2023-01-18 12:41:44 +01:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2022-10-10 15:53:48 -04:00
2022-02-09 09:11:49 -05:00
2023-08-11 08:42:01 -04:00
2024-09-16 08:58:50 -04:00
2023-06-27 01:15:45 +03:00
2023-06-27 01:15:45 +03:00
2023-06-27 01:15:45 +03:00
2023-08-28 12:13:42 -04:00
2022-04-08 16:19:58 -04:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2022-03-31 13:45:39 -04:00
2022-02-09 09:11:49 -05:00
2023-03-17 18:31:44 +01:00
2022-07-25 11:48:24 +08:00
2022-07-25 11:48:24 +08:00