* [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
@ 2021-06-09 0:25 Marek Polacek
2021-06-10 19:09 ` Jason Merrill
0 siblings, 1 reply; 6+ messages in thread
From: Marek Polacek @ 2021-06-09 0:25 UTC (permalink / raw)
To: Jason Merrill, GCC Patches
We weren't passing 'flags' to the recursive call to cp_parser_declarator
in the ptr-operator case and as an effect, delayed parsing of noexcept
didn't work as advertised. The following change passes more than just
CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
I'm not passing member_p because I don't need it and because it breaks
a few tests.
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
PR c++/100752
gcc/cp/ChangeLog:
* parser.c (cp_parser_declarator): Pass flags down to
cp_parser_declarator.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/noexcept69.C: New test.
---
gcc/cp/parser.c | 3 +--
gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d59a829d0b9..5930990ec1c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Parse the dependent declarator. */
- declarator = cp_parser_declarator (parser, dcl_kind,
- CP_PARSER_FLAGS_NONE,
+ declarator = cp_parser_declarator (parser, dcl_kind, flags,
/*ctor_dtor_or_conv_p=*/NULL,
/*parenthesized_p=*/NULL,
/*member_p=*/false,
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept69.C b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
new file mode 100644
index 00000000000..9b87ba0cafb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
@@ -0,0 +1,12 @@
+// PR c++/100752
+// { dg-do compile { target c++11 } }
+
+struct S {
+ void f() noexcept {}
+ S &g() noexcept(noexcept(f())) { f(); return *this; }
+};
+
+struct X {
+ int& f() noexcept(noexcept(i));
+ int i;
+};
base-commit: c4574d23cb07340918793a5a98ae7bb2988b3791
--
2.31.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
2021-06-09 0:25 [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752] Marek Polacek
@ 2021-06-10 19:09 ` Jason Merrill
2021-06-10 21:19 ` Marek Polacek
0 siblings, 1 reply; 6+ messages in thread
From: Jason Merrill @ 2021-06-10 19:09 UTC (permalink / raw)
To: Marek Polacek, GCC Patches
On 6/8/21 8:25 PM, Marek Polacek wrote:
> We weren't passing 'flags' to the recursive call to cp_parser_declarator
> in the ptr-operator case and as an effect, delayed parsing of noexcept
> didn't work as advertised. The following change passes more than just
> CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
>
> I'm not passing member_p because I don't need it and because it breaks
> a few tests.
>
> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
>
> PR c++/100752
>
> gcc/cp/ChangeLog:
>
> * parser.c (cp_parser_declarator): Pass flags down to
> cp_parser_declarator.
>
> gcc/testsuite/ChangeLog:
>
> * g++.dg/cpp0x/noexcept69.C: New test.
> ---
> gcc/cp/parser.c | 3 +--
> gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
> 2 files changed, 13 insertions(+), 2 deletions(-)
> create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
>
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index d59a829d0b9..5930990ec1c 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
> cp_parser_parse_tentatively (parser);
>
> /* Parse the dependent declarator. */
> - declarator = cp_parser_declarator (parser, dcl_kind,
> - CP_PARSER_FLAGS_NONE,
> + declarator = cp_parser_declarator (parser, dcl_kind, flags,
> /*ctor_dtor_or_conv_p=*/NULL,
> /*parenthesized_p=*/NULL,
> /*member_p=*/false,
Should the other parameters also be passed down? I'd think definitely
member_p and static_p, not sure about ctor_dtor_or_conv_p and
parenthesized_p.
> diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept69.C b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> new file mode 100644
> index 00000000000..9b87ba0cafb
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> @@ -0,0 +1,12 @@
> +// PR c++/100752
> +// { dg-do compile { target c++11 } }
> +
> +struct S {
> + void f() noexcept {}
> + S &g() noexcept(noexcept(f())) { f(); return *this; }
> +};
> +
> +struct X {
> + int& f() noexcept(noexcept(i));
> + int i;
> +};
>
> base-commit: c4574d23cb07340918793a5a98ae7bb2988b3791
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
2021-06-10 19:09 ` Jason Merrill
@ 2021-06-10 21:19 ` Marek Polacek
2021-06-11 2:31 ` Jason Merrill
0 siblings, 1 reply; 6+ messages in thread
From: Marek Polacek @ 2021-06-10 21:19 UTC (permalink / raw)
To: Jason Merrill; +Cc: GCC Patches
On Thu, Jun 10, 2021 at 03:09:29PM -0400, Jason Merrill wrote:
> On 6/8/21 8:25 PM, Marek Polacek wrote:
> > We weren't passing 'flags' to the recursive call to cp_parser_declarator
> > in the ptr-operator case and as an effect, delayed parsing of noexcept
> > didn't work as advertised. The following change passes more than just
> > CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
> >
> > I'm not passing member_p because I don't need it and because it breaks
> > a few tests.
> >
> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
> >
> > PR c++/100752
> >
> > gcc/cp/ChangeLog:
> >
> > * parser.c (cp_parser_declarator): Pass flags down to
> > cp_parser_declarator.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * g++.dg/cpp0x/noexcept69.C: New test.
> > ---
> > gcc/cp/parser.c | 3 +--
> > gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
> > 2 files changed, 13 insertions(+), 2 deletions(-)
> > create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> >
> > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> > index d59a829d0b9..5930990ec1c 100644
> > --- a/gcc/cp/parser.c
> > +++ b/gcc/cp/parser.c
> > @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
> > cp_parser_parse_tentatively (parser);
> > /* Parse the dependent declarator. */
> > - declarator = cp_parser_declarator (parser, dcl_kind,
> > - CP_PARSER_FLAGS_NONE,
> > + declarator = cp_parser_declarator (parser, dcl_kind, flags,
> > /*ctor_dtor_or_conv_p=*/NULL,
> > /*parenthesized_p=*/NULL,
> > /*member_p=*/false,
>
> Should the other parameters also be passed down? I'd think definitely
> member_p and static_p, not sure about ctor_dtor_or_conv_p and
> parenthesized_p.
Hmm, as I mentioned in the patch description, I tried, but passing member_p
broke a few tests and since it's not needed for this fix I gave up
investigating why. I could look into it if you're curious :).
Marek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
2021-06-10 21:19 ` Marek Polacek
@ 2021-06-11 2:31 ` Jason Merrill
2021-06-25 20:42 ` [PATCH v2] " Marek Polacek
0 siblings, 1 reply; 6+ messages in thread
From: Jason Merrill @ 2021-06-11 2:31 UTC (permalink / raw)
To: Marek Polacek; +Cc: GCC Patches
On 6/10/21 5:19 PM, Marek Polacek wrote:
> On Thu, Jun 10, 2021 at 03:09:29PM -0400, Jason Merrill wrote:
>> On 6/8/21 8:25 PM, Marek Polacek wrote:
>>> We weren't passing 'flags' to the recursive call to cp_parser_declarator
>>> in the ptr-operator case and as an effect, delayed parsing of noexcept
>>> didn't work as advertised. The following change passes more than just
>>> CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
>>>
>>> I'm not passing member_p because I don't need it and because it breaks
>>> a few tests.
>>>
>>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
>>>
>>> PR c++/100752
>>>
>>> gcc/cp/ChangeLog:
>>>
>>> * parser.c (cp_parser_declarator): Pass flags down to
>>> cp_parser_declarator.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>> * g++.dg/cpp0x/noexcept69.C: New test.
>>> ---
>>> gcc/cp/parser.c | 3 +--
>>> gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
>>> 2 files changed, 13 insertions(+), 2 deletions(-)
>>> create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
>>>
>>> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
>>> index d59a829d0b9..5930990ec1c 100644
>>> --- a/gcc/cp/parser.c
>>> +++ b/gcc/cp/parser.c
>>> @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
>>> cp_parser_parse_tentatively (parser);
>>> /* Parse the dependent declarator. */
>>> - declarator = cp_parser_declarator (parser, dcl_kind,
>>> - CP_PARSER_FLAGS_NONE,
>>> + declarator = cp_parser_declarator (parser, dcl_kind, flags,
>>> /*ctor_dtor_or_conv_p=*/NULL,
>>> /*parenthesized_p=*/NULL,
>>> /*member_p=*/false,
>>
>> Should the other parameters also be passed down? I'd think definitely
>> member_p and static_p, not sure about ctor_dtor_or_conv_p and
>> parenthesized_p.
>
> Hmm, as I mentioned in the patch description, I tried, but passing member_p
> broke a few tests and since it's not needed for this fix I gave up
> investigating why. I could look into it if you're curious :).
Please.
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
2021-06-11 2:31 ` Jason Merrill
@ 2021-06-25 20:42 ` Marek Polacek
2021-06-25 20:47 ` Jason Merrill
0 siblings, 1 reply; 6+ messages in thread
From: Marek Polacek @ 2021-06-25 20:42 UTC (permalink / raw)
To: Jason Merrill; +Cc: GCC Patches
On Thu, Jun 10, 2021 at 10:31:33PM -0400, Jason Merrill wrote:
> On 6/10/21 5:19 PM, Marek Polacek wrote:
> > On Thu, Jun 10, 2021 at 03:09:29PM -0400, Jason Merrill wrote:
> > > On 6/8/21 8:25 PM, Marek Polacek wrote:
> > > > We weren't passing 'flags' to the recursive call to cp_parser_declarator
> > > > in the ptr-operator case and as an effect, delayed parsing of noexcept
> > > > didn't work as advertised. The following change passes more than just
> > > > CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
> > > >
> > > > I'm not passing member_p because I don't need it and because it breaks
> > > > a few tests.
> > > >
> > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
> > > >
> > > > PR c++/100752
> > > >
> > > > gcc/cp/ChangeLog:
> > > >
> > > > * parser.c (cp_parser_declarator): Pass flags down to
> > > > cp_parser_declarator.
> > > >
> > > > gcc/testsuite/ChangeLog:
> > > >
> > > > * g++.dg/cpp0x/noexcept69.C: New test.
> > > > ---
> > > > gcc/cp/parser.c | 3 +--
> > > > gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
> > > > 2 files changed, 13 insertions(+), 2 deletions(-)
> > > > create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> > > >
> > > > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> > > > index d59a829d0b9..5930990ec1c 100644
> > > > --- a/gcc/cp/parser.c
> > > > +++ b/gcc/cp/parser.c
> > > > @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
> > > > cp_parser_parse_tentatively (parser);
> > > > /* Parse the dependent declarator. */
> > > > - declarator = cp_parser_declarator (parser, dcl_kind,
> > > > - CP_PARSER_FLAGS_NONE,
> > > > + declarator = cp_parser_declarator (parser, dcl_kind, flags,
> > > > /*ctor_dtor_or_conv_p=*/NULL,
> > > > /*parenthesized_p=*/NULL,
> > > > /*member_p=*/false,
> > >
> > > Should the other parameters also be passed down? I'd think definitely
> > > member_p and static_p, not sure about ctor_dtor_or_conv_p and
> > > parenthesized_p.
> >
> > Hmm, as I mentioned in the patch description, I tried, but passing member_p
> > broke a few tests and since it's not needed for this fix I gave up
> > investigating why. I could look into it if you're curious :).
>
> Please.
Turns out those were just trivial changes to the expected error messages.
The following patch passes member_p and static_p too:
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?
-- >8 --
We weren't passing 'flags' to the recursive call to cp_parser_declarator
in the ptr-operator case and as an effect, delayed parsing of noexcept
didn't work as advertised. The following change passes more than just
CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
I'm now also passing member_p and static_p, as a consequence, two tests
needed small tweaks.
PR c++/100752
gcc/cp/ChangeLog:
* parser.c (cp_parser_declarator): Pass flags down to
cp_parser_declarator. Also pass static_p/member_p.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/noexcept69.C: New test.
* g++.dg/parse/saved1.C: Adjust dg-error.
* g++.dg/template/crash50.C: Likewise.
---
gcc/cp/parser.c | 6 ++----
gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
gcc/testsuite/g++.dg/parse/saved1.C | 4 ++--
gcc/testsuite/g++.dg/template/crash50.C | 2 +-
4 files changed, 17 insertions(+), 7 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 096580e7e50..02daa7a6f6a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22170,12 +22170,10 @@ cp_parser_declarator (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Parse the dependent declarator. */
- declarator = cp_parser_declarator (parser, dcl_kind,
- CP_PARSER_FLAGS_NONE,
+ declarator = cp_parser_declarator (parser, dcl_kind, flags,
/*ctor_dtor_or_conv_p=*/NULL,
/*parenthesized_p=*/NULL,
- /*member_p=*/false,
- friend_p, /*static_p=*/false);
+ member_p, friend_p, static_p);
/* If we are parsing an abstract-declarator, we must handle the
case where the dependent declarator is absent. */
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept69.C b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
new file mode 100644
index 00000000000..9b87ba0cafb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
@@ -0,0 +1,12 @@
+// PR c++/100752
+// { dg-do compile { target c++11 } }
+
+struct S {
+ void f() noexcept {}
+ S &g() noexcept(noexcept(f())) { f(); return *this; }
+};
+
+struct X {
+ int& f() noexcept(noexcept(i));
+ int i;
+};
diff --git a/gcc/testsuite/g++.dg/parse/saved1.C b/gcc/testsuite/g++.dg/parse/saved1.C
index 979a05676d2..1deaa93f516 100644
--- a/gcc/testsuite/g++.dg/parse/saved1.C
+++ b/gcc/testsuite/g++.dg/parse/saved1.C
@@ -1,7 +1,7 @@
// Test that the parser doesn't go into an infinite loop from ignoring the
// PRE_PARSED_FUNCTION_DECL token.
-class C { static void* operator new(size_t); }; // { dg-error "24:declaration of .operator new. as non-function" }
-// { dg-error "expected|ISO C\\+\\+ forbids" "" { target *-*-* } .-1 }
+class C { static void* operator new(size_t); }; // { dg-error "37:.size_t. has not been declared" }
+// { dg-error ".operator new. takes type .size_t." "" { target *-*-* } .-1 }
void* C::operator new(size_t) { return 0; } // { dg-error "" }
class D { D(int i): integer(i){}}; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/crash50.C b/gcc/testsuite/g++.dg/template/crash50.C
index 286685ac838..4b846cdabc8 100644
--- a/gcc/testsuite/g++.dg/template/crash50.C
+++ b/gcc/testsuite/g++.dg/template/crash50.C
@@ -3,5 +3,5 @@
struct A
{
- template<int> void* foo(; // { dg-error "primary-expression|initialization|static|template" }
+ template<int> void* foo(; // { dg-error "expected|initialization|static|template" }
};
base-commit: 74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8
--
2.31.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
2021-06-25 20:42 ` [PATCH v2] " Marek Polacek
@ 2021-06-25 20:47 ` Jason Merrill
0 siblings, 0 replies; 6+ messages in thread
From: Jason Merrill @ 2021-06-25 20:47 UTC (permalink / raw)
To: Marek Polacek; +Cc: GCC Patches
On 6/25/21 4:42 PM, Marek Polacek wrote:
> On Thu, Jun 10, 2021 at 10:31:33PM -0400, Jason Merrill wrote:
>> On 6/10/21 5:19 PM, Marek Polacek wrote:
>>> On Thu, Jun 10, 2021 at 03:09:29PM -0400, Jason Merrill wrote:
>>>> On 6/8/21 8:25 PM, Marek Polacek wrote:
>>>>> We weren't passing 'flags' to the recursive call to cp_parser_declarator
>>>>> in the ptr-operator case and as an effect, delayed parsing of noexcept
>>>>> didn't work as advertised. The following change passes more than just
>>>>> CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
>>>>>
>>>>> I'm not passing member_p because I don't need it and because it breaks
>>>>> a few tests.
>>>>>
>>>>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
>>>>>
>>>>> PR c++/100752
>>>>>
>>>>> gcc/cp/ChangeLog:
>>>>>
>>>>> * parser.c (cp_parser_declarator): Pass flags down to
>>>>> cp_parser_declarator.
>>>>>
>>>>> gcc/testsuite/ChangeLog:
>>>>>
>>>>> * g++.dg/cpp0x/noexcept69.C: New test.
>>>>> ---
>>>>> gcc/cp/parser.c | 3 +--
>>>>> gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
>>>>> 2 files changed, 13 insertions(+), 2 deletions(-)
>>>>> create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
>>>>>
>>>>> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
>>>>> index d59a829d0b9..5930990ec1c 100644
>>>>> --- a/gcc/cp/parser.c
>>>>> +++ b/gcc/cp/parser.c
>>>>> @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
>>>>> cp_parser_parse_tentatively (parser);
>>>>> /* Parse the dependent declarator. */
>>>>> - declarator = cp_parser_declarator (parser, dcl_kind,
>>>>> - CP_PARSER_FLAGS_NONE,
>>>>> + declarator = cp_parser_declarator (parser, dcl_kind, flags,
>>>>> /*ctor_dtor_or_conv_p=*/NULL,
>>>>> /*parenthesized_p=*/NULL,
>>>>> /*member_p=*/false,
>>>>
>>>> Should the other parameters also be passed down? I'd think definitely
>>>> member_p and static_p, not sure about ctor_dtor_or_conv_p and
>>>> parenthesized_p.
>>>
>>> Hmm, as I mentioned in the patch description, I tried, but passing member_p
>>> broke a few tests and since it's not needed for this fix I gave up
>>> investigating why. I could look into it if you're curious :).
>>
>> Please.
>
> Turns out those were just trivial changes to the expected error messages.
> The following patch passes member_p and static_p too:
>
> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?
OK.
> -- >8 --
> We weren't passing 'flags' to the recursive call to cp_parser_declarator
> in the ptr-operator case and as an effect, delayed parsing of noexcept
> didn't work as advertised. The following change passes more than just
> CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
>
> I'm now also passing member_p and static_p, as a consequence, two tests
> needed small tweaks.
>
> PR c++/100752
>
> gcc/cp/ChangeLog:
>
> * parser.c (cp_parser_declarator): Pass flags down to
> cp_parser_declarator. Also pass static_p/member_p.
>
> gcc/testsuite/ChangeLog:
>
> * g++.dg/cpp0x/noexcept69.C: New test.
> * g++.dg/parse/saved1.C: Adjust dg-error.
> * g++.dg/template/crash50.C: Likewise.
> ---
> gcc/cp/parser.c | 6 ++----
> gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
> gcc/testsuite/g++.dg/parse/saved1.C | 4 ++--
> gcc/testsuite/g++.dg/template/crash50.C | 2 +-
> 4 files changed, 17 insertions(+), 7 deletions(-)
> create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
>
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index 096580e7e50..02daa7a6f6a 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -22170,12 +22170,10 @@ cp_parser_declarator (cp_parser* parser,
> cp_parser_parse_tentatively (parser);
>
> /* Parse the dependent declarator. */
> - declarator = cp_parser_declarator (parser, dcl_kind,
> - CP_PARSER_FLAGS_NONE,
> + declarator = cp_parser_declarator (parser, dcl_kind, flags,
> /*ctor_dtor_or_conv_p=*/NULL,
> /*parenthesized_p=*/NULL,
> - /*member_p=*/false,
> - friend_p, /*static_p=*/false);
> + member_p, friend_p, static_p);
>
> /* If we are parsing an abstract-declarator, we must handle the
> case where the dependent declarator is absent. */
> diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept69.C b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> new file mode 100644
> index 00000000000..9b87ba0cafb
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> @@ -0,0 +1,12 @@
> +// PR c++/100752
> +// { dg-do compile { target c++11 } }
> +
> +struct S {
> + void f() noexcept {}
> + S &g() noexcept(noexcept(f())) { f(); return *this; }
> +};
> +
> +struct X {
> + int& f() noexcept(noexcept(i));
> + int i;
> +};
> diff --git a/gcc/testsuite/g++.dg/parse/saved1.C b/gcc/testsuite/g++.dg/parse/saved1.C
> index 979a05676d2..1deaa93f516 100644
> --- a/gcc/testsuite/g++.dg/parse/saved1.C
> +++ b/gcc/testsuite/g++.dg/parse/saved1.C
> @@ -1,7 +1,7 @@
> // Test that the parser doesn't go into an infinite loop from ignoring the
> // PRE_PARSED_FUNCTION_DECL token.
>
> -class C { static void* operator new(size_t); }; // { dg-error "24:declaration of .operator new. as non-function" }
> -// { dg-error "expected|ISO C\\+\\+ forbids" "" { target *-*-* } .-1 }
> +class C { static void* operator new(size_t); }; // { dg-error "37:.size_t. has not been declared" }
> +// { dg-error ".operator new. takes type .size_t." "" { target *-*-* } .-1 }
> void* C::operator new(size_t) { return 0; } // { dg-error "" }
> class D { D(int i): integer(i){}}; // { dg-error "" }
> diff --git a/gcc/testsuite/g++.dg/template/crash50.C b/gcc/testsuite/g++.dg/template/crash50.C
> index 286685ac838..4b846cdabc8 100644
> --- a/gcc/testsuite/g++.dg/template/crash50.C
> +++ b/gcc/testsuite/g++.dg/template/crash50.C
> @@ -3,5 +3,5 @@
>
> struct A
> {
> - template<int> void* foo(; // { dg-error "primary-expression|initialization|static|template" }
> + template<int> void* foo(; // { dg-error "expected|initialization|static|template" }
> };
>
> base-commit: 74ebd1297e9cfa9f7d05bfcac5510d4968cc6ba8
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-06-25 20:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 0:25 [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752] Marek Polacek
2021-06-10 19:09 ` Jason Merrill
2021-06-10 21:19 ` Marek Polacek
2021-06-11 2:31 ` Jason Merrill
2021-06-25 20:42 ` [PATCH v2] " Marek Polacek
2021-06-25 20:47 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).