diff mbox series

PR c++/103338 - Add testcase for issue fixed by recent commit

Message ID 0102018fe3f5ad81-79fae8b3-4947-44bf-8e83-4ec3990d1aec-000000@eu-west-1.amazonses.com
State New
Headers show
Series PR c++/103338 - Add testcase for issue fixed by recent commit | expand

Commit Message

Simon Martin June 4, 2024, 3:54 p.m. UTC
The case in that PR used to ICE until commit f04dc89. This patch simply adds
the case to the testsuite.

Successfully tested on x86_64-pc-linux-gnu.

	PR c++/1033388

gcc/testsuite/ChangeLog:

	* g++.dg/parse/crash73.C: New test.

---
 gcc/testsuite/g++.dg/parse/crash73.C | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/parse/crash73.C

Comments

Jason Merrill June 4, 2024, 4:12 p.m. UTC | #1
On 6/4/24 11:54, Simon Martin wrote:
> The case in that PR used to ICE until commit f04dc89.

Interesting, I don't remember expecting that patch to change behavior at 
all.

BTW, it looks like your recent commits and emails have had 
non-conventional subject lines; see 
https://gcc.gnu.org/contribute.html#patches for more guidance.

For instance, the subject for this patch could be

c++: add testcase for PR103338

OK with that adjustment.

> This patch simply adds
> the case to the testsuite.
> 
> Successfully tested on x86_64-pc-linux-gnu.
> 
> 	PR c++/1033388
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/parse/crash73.C: New test.
> 
> ---
>   gcc/testsuite/g++.dg/parse/crash73.C | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>   create mode 100644 gcc/testsuite/g++.dg/parse/crash73.C
> 
> diff --git a/gcc/testsuite/g++.dg/parse/crash73.C b/gcc/testsuite/g++.dg/parse/crash73.C
> new file mode 100644
> index 00000000000..5923b98b719
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/parse/crash73.C
> @@ -0,0 +1,19 @@
> +// PR c++/1033388
> +// { dg-do compile { target c++11 } }
> +
> +template<class...>
> +struct zip_view {
> +  struct Iterator;
> +};
> +
> +template<class...>
> +struct zip_transform_view;
> +
> +template<class... Views>
> +struct zip_view<Views...>::Iterator { // { dg-error "no class template" }
> +  template<class... Uiews>
> +  template<bool>
> +  friend class zip_transform_view<Uiews...>::Iterator;
> +};
> +
> +zip_view<>::Iterator iter;
Simon Martin June 4, 2024, 4:42 p.m. UTC | #2
Hi Jason,

On 4 Jun 2024, at 18:12, Jason Merrill wrote:

> On 6/4/24 11:54, Simon Martin wrote:
>> The case in that PR used to ICE until commit f04dc89.
>
> Interesting, I don't remember expecting that patch to change behavior 
> at all.
This is the patch that git bisect identified. I have to admit that I did 
not look further.

> BTW, it looks like your recent commits and emails have had 
> non-conventional subject lines; see 
> https://gcc.gnu.org/contribute.html#patches for more guidance.
>
Thanks for the pointer and apologies for not providing great subject 
lines; I’ll fix this moving forward (starting with that patch).

> For instance, the subject for this patch could be
>
> c++: add testcase for PR103338
>
> OK with that adjustment.
Thanks again.
>
>> This patch simply adds
>> the case to the testsuite.
>>
>> Successfully tested on x86_64-pc-linux-gnu.
>>
>> 	PR c++/1033388
>>
>> gcc/testsuite/ChangeLog:
>>
>> 	* g++.dg/parse/crash73.C: New test.
>>
>> ---
>>   gcc/testsuite/g++.dg/parse/crash73.C | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>   create mode 100644 gcc/testsuite/g++.dg/parse/crash73.C
>>
>> diff --git a/gcc/testsuite/g++.dg/parse/crash73.C 
>> b/gcc/testsuite/g++.dg/parse/crash73.C
>> new file mode 100644
>> index 00000000000..5923b98b719
>> --- /dev/null
>> +++ b/gcc/testsuite/g++.dg/parse/crash73.C
>> @@ -0,0 +1,19 @@
>> +// PR c++/1033388
>> +// { dg-do compile { target c++11 } }
>> +
>> +template<class...>
>> +struct zip_view {
>> +  struct Iterator;
>> +};
>> +
>> +template<class...>
>> +struct zip_transform_view;
>> +
>> +template<class... Views>
>> +struct zip_view<Views...>::Iterator { // { dg-error "no class 
>> template" }
>> +  template<class... Uiews>
>> +  template<bool>
>> +  friend class zip_transform_view<Uiews...>::Iterator;
>> +};
>> +
>> +zip_view<>::Iterator iter;
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/parse/crash73.C b/gcc/testsuite/g++.dg/parse/crash73.C
new file mode 100644
index 00000000000..5923b98b719
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash73.C
@@ -0,0 +1,19 @@ 
+// PR c++/1033388
+// { dg-do compile { target c++11 } }
+
+template<class...>
+struct zip_view {
+  struct Iterator;
+};
+
+template<class...>
+struct zip_transform_view;
+
+template<class... Views>
+struct zip_view<Views...>::Iterator { // { dg-error "no class template" }
+  template<class... Uiews>
+  template<bool>
+  friend class zip_transform_view<Uiews...>::Iterator;
+};
+
+zip_view<>::Iterator iter;