Re: PR C++/63149
On Wed, 5 Jun 2019 at 19:19, Jason Merrill wrote: > On 6/5/19 1:29 PM, Nina Dinka Ranns wrote: > > Ack. Amended change log is below. Changes are : > > * changed C++ -> c++ > > * fixed the name of added test > > > > There are no changes in the diff, but I attached it to this e-mail for > > reference. > > Applied, thanks! > > For future reference it's also customary to add a bit of discussion of > the rationale for the patch. Also, please include the word "PATCH" on > the subject line. Noted. Thank you, Nina > > Jason >
Re: PR C++/63149
On 6/5/19 1:29 PM, Nina Dinka Ranns wrote: Ack. Amended change log is below. Changes are : * changed C++ -> c++ * fixed the name of added test There are no changes in the diff, but I attached it to this e-mail for reference. Applied, thanks! For future reference it's also customary to add a bit of discussion of the rationale for the patch. Also, please include the word "PATCH" on the subject line. Jason
Re: PR C++/63149
Ack. Amended change log is below. Changes are : * changed C++ -> c++ * fixed the name of added test There are no changes in the diff, but I attached it to this e-mail for reference. Thanks, Nina 2019-06-04 Nina Dinka Ranns gcc/cp PR c++/63149 * pt.c (listify_autos): Use non cv qualified auto_node in std::initializer_list. testsuite/ PR c++/63149 * g++.dg/cpp0x/initlist-deduce2.C: New test. On Wed, 5 Jun 2019 at 13:59, Marek Polacek wrote: > > On Wed, Jun 05, 2019 at 02:50:54PM +0200, Jakub Jelinek wrote: > > On Wed, Jun 05, 2019 at 08:39:56AM -0400, Marek Polacek wrote: > > > On Wed, Jun 05, 2019 at 10:34:05AM +0100, Nina Dinka Ranns wrote: > > > > > PR C++/63149 > > > > > * pt.c (listify_autos): Use non cv qualified auto_node in > > > > > std::initializer_list. > > > > > > > > > > testsuite/ > > > > > > > > > > PR C++/63149 > > > > > > "c++" instead of "C++", thought I don't think anyone would mind. > > > > I would, I have scripts that grab the PR strings from ChangeLog entries > > and need to fix stuff by hand if it is incorrect like this (or if people > > forget to use the component/ part altogether). > > Fair enough. Nina, please adjust that too, then. > > Marek Index: gcc/cp/pt.c === --- gcc/cp/pt.c (revision 271709) +++ gcc/cp/pt.c (working copy) @@ -26836,7 +26836,7 @@ static tree listify_autos (tree type, tree auto_node) { - tree init_auto = listify (auto_node); + tree init_auto = listify (strip_top_quals (auto_node)); tree argvec = make_tree_vec (1); TREE_VEC_ELT (argvec, 0) = init_auto; if (processing_template_decl) Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C === --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) @@ -0,0 +1,8 @@ +// Test for PR63149 +// { dg-do compile { target c++11 } } + +#include + +const auto r = { 1, 2, 3 }; +using X = decltype(r); +using X = const std::initializer_list;
Re: PR C++/63149
On Wed, Jun 05, 2019 at 02:50:54PM +0200, Jakub Jelinek wrote: > On Wed, Jun 05, 2019 at 08:39:56AM -0400, Marek Polacek wrote: > > On Wed, Jun 05, 2019 at 10:34:05AM +0100, Nina Dinka Ranns wrote: > > > > PR C++/63149 > > > > * pt.c (listify_autos): Use non cv qualified auto_node in > > > > std::initializer_list. > > > > > > > > testsuite/ > > > > > > > > PR C++/63149 > > > > "c++" instead of "C++", thought I don't think anyone would mind. > > I would, I have scripts that grab the PR strings from ChangeLog entries > and need to fix stuff by hand if it is incorrect like this (or if people > forget to use the component/ part altogether). Fair enough. Nina, please adjust that too, then. Marek
Re: PR C++/63149
On Wed, Jun 05, 2019 at 08:39:56AM -0400, Marek Polacek wrote: > On Wed, Jun 05, 2019 at 10:34:05AM +0100, Nina Dinka Ranns wrote: > > > PR C++/63149 > > > * pt.c (listify_autos): Use non cv qualified auto_node in > > > std::initializer_list. > > > > > > testsuite/ > > > > > > PR C++/63149 > > "c++" instead of "C++", thought I don't think anyone would mind. I would, I have scripts that grab the PR strings from ChangeLog entries and need to fix stuff by hand if it is incorrect like this (or if people forget to use the component/ part altogether). Jakub
Re: PR C++/63149
On Wed, Jun 05, 2019 at 10:34:05AM +0100, Nina Dinka Ranns wrote: > > PR C++/63149 > > * pt.c (listify_autos): Use non cv qualified auto_node in > > std::initializer_list. > > > > testsuite/ > > > > PR C++/63149 "c++" instead of "C++", thought I don't think anyone would mind. > > * g++.dg/cpp0x/initlist-deduce.C: New test. You're actually adding initlist-deduce2.C. Marek
Re: PR C++/63149
yes, I forgot to attach the latest patch. :) On Wed, 5 Jun 2019 at 10:24, Nina Dinka Ranns wrote: > > Hi both, > Addressing all comments in this e-mail, as some are duplicate. > > On Tue, 4 Jun 2019 at 20:45, Paolo Carlini wrote: > > > > Hi, > > > > On 04/06/19 21:26, Nina Dinka Ranns wrote: > > > > Good point, dg-do compile is sufficient to demonstrate the issue. > > > > I agree. > > > > A couple of additional nits, sorry for mentioning only now. > > > > > > C++63149_2.diff > > > > Index: gcc/cp/pt.c > > === > > --- gcc/cp/pt.c (revision 271709) > > +++ gcc/cp/pt.c (working copy) > > @@ -26836,7 +26836,7 @@ > > static tree > > listify_autos (tree type, tree auto_node) > > { > > - tree init_auto = listify (auto_node); > > + tree init_auto = listify (strip_top_quals(auto_node)); > > > > You want a space after strip_top_quals. > > fixed. > > > > >tree argvec = make_tree_vec (1); > >TREE_VEC_ELT (argvec, 0) = init_auto; > >if (processing_template_decl) > > Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C > > === > > --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) > > +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) > > @@ -0,0 +1,12 @@ > > +// Test for PR63149 > > +// { dg-do compile { target c++11 } } > > + > > +#include > > + > > +const auto r = { 1, 2, 3 }; > > +using X = decltype(r); > > +using X = const std::initializer_list; > > + > > +int main() > > +{ > > +} > > > > With dg-do compile you don't need a main anymore. > > > fixed > > > I seem to remember also a couple of minor formatting issues in the > > ChangeLog entry: just harmonize the format with everything else you find in > > the ChangeLog, in terms of the usual trivial details: upper cases, line > > lenghts and line wraps, etc. > > > > Below is the amended change log. If there is anything else off, I > would need specifics as I've made all the changes I could spot myself. > :) > > Thanks, > Nina > > 2019-06-04 Nina Dinka Ranns > gcc/cp > > PR C++/63149 > * pt.c (listify_autos): Use non cv qualified auto_node in > std::initializer_list. > > testsuite/ > > PR C++/63149 > * g++.dg/cpp0x/initlist-deduce.C: New test. Index: gcc/cp/pt.c === --- gcc/cp/pt.c (revision 271709) +++ gcc/cp/pt.c (working copy) @@ -26836,7 +26836,7 @@ static tree listify_autos (tree type, tree auto_node) { - tree init_auto = listify (auto_node); + tree init_auto = listify (strip_top_quals (auto_node)); tree argvec = make_tree_vec (1); TREE_VEC_ELT (argvec, 0) = init_auto; if (processing_template_decl) Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C === --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) @@ -0,0 +1,8 @@ +// Test for PR63149 +// { dg-do compile { target c++11 } } + +#include + +const auto r = { 1, 2, 3 }; +using X = decltype(r); +using X = const std::initializer_list;
Re: PR C++/63149
Hi both, Addressing all comments in this e-mail, as some are duplicate. On Tue, 4 Jun 2019 at 20:45, Paolo Carlini wrote: > > Hi, > > On 04/06/19 21:26, Nina Dinka Ranns wrote: > > Good point, dg-do compile is sufficient to demonstrate the issue. > > I agree. > > A couple of additional nits, sorry for mentioning only now. > > > C++63149_2.diff > > Index: gcc/cp/pt.c > === > --- gcc/cp/pt.c (revision 271709) > +++ gcc/cp/pt.c (working copy) > @@ -26836,7 +26836,7 @@ > static tree > listify_autos (tree type, tree auto_node) > { > - tree init_auto = listify (auto_node); > + tree init_auto = listify (strip_top_quals(auto_node)); > > You want a space after strip_top_quals. fixed. > >tree argvec = make_tree_vec (1); >TREE_VEC_ELT (argvec, 0) = init_auto; >if (processing_template_decl) > Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C > === > --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) > +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) > @@ -0,0 +1,12 @@ > +// Test for PR63149 > +// { dg-do compile { target c++11 } } > + > +#include > + > +const auto r = { 1, 2, 3 }; > +using X = decltype(r); > +using X = const std::initializer_list; > + > +int main() > +{ > +} > > With dg-do compile you don't need a main anymore. > fixed > I seem to remember also a couple of minor formatting issues in the ChangeLog > entry: just harmonize the format with everything else you find in the > ChangeLog, in terms of the usual trivial details: upper cases, line lenghts > and line wraps, etc. > Below is the amended change log. If there is anything else off, I would need specifics as I've made all the changes I could spot myself. :) Thanks, Nina 2019-06-04 Nina Dinka Ranns gcc/cp PR C++/63149 * pt.c (listify_autos): Use non cv qualified auto_node in std::initializer_list. testsuite/ PR C++/63149 * g++.dg/cpp0x/initlist-deduce.C: New test.
Re: PR C++/63149
On Tue, Jun 04, 2019 at 08:26:58PM +0100, Nina Dinka Ranns wrote: ChangeLog entry is missing. > Index: gcc/cp/pt.c > === > --- gcc/cp/pt.c (revision 271709) > +++ gcc/cp/pt.c (working copy) > @@ -26836,7 +26836,7 @@ > static tree > listify_autos (tree type, tree auto_node) > { > - tree init_auto = listify (auto_node); > + tree init_auto = listify (strip_top_quals(auto_node)); There should be space before ( in the function call. >tree argvec = make_tree_vec (1); >TREE_VEC_ELT (argvec, 0) = init_auto; >if (processing_template_decl) > Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C > === > --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) > +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) > @@ -0,0 +1,12 @@ > +// Test for PR63149 > +// { dg-do compile { target c++11 } } > + > +#include > + > +const auto r = { 1, 2, 3 }; > +using X = decltype(r); > +using X = const std::initializer_list; > + > +int main() > +{ > +} No need for main in dg-do compile test if it is not needed for what the test wants to test. Jakub
Re: PR C++/63149
Hi, On 04/06/19 21:26, Nina Dinka Ranns wrote: Good point, dg-do compile is sufficient to demonstrate the issue. I agree. A couple of additional nits, sorry for mentioning only now. C++63149_2.diff Index: gcc/cp/pt.c === --- gcc/cp/pt.c (revision 271709) +++ gcc/cp/pt.c (working copy) @@ -26836,7 +26836,7 @@ static tree listify_autos (tree type, tree auto_node) { - tree init_auto = listify (auto_node); + tree init_auto = listify (strip_top_quals(auto_node)); You want a space after strip_top_quals. tree argvec = make_tree_vec (1); TREE_VEC_ELT (argvec, 0) = init_auto; if (processing_template_decl) Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C === --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) @@ -0,0 +1,12 @@ +// Test for PR63149 +// { dg-do compile { target c++11 } } + +#include + +const auto r = { 1, 2, 3 }; +using X = decltype(r); +using X = const std::initializer_list; + +int main() +{ +} With dg-do compile you don't need a main anymore. I seem to remember also a couple of minor formatting issues in the ChangeLog entry: just harmonize the format with everything else you find in the ChangeLog, in terms of the usual trivial details: upper cases, line lenghts and line wraps, etc. Paolo.
Re: PR C++/63149
Good point, dg-do compile is sufficient to demonstrate the issue. Amended, new patch attached. Thanks, Nina On Tue, 4 Jun 2019 at 17:53, Paolo Carlini wrote: > > Hi, > > On 04/06/19 18:36, Nina Dinka Ranns wrote: > > +// Test for PR63149 > > +// { dg-do run { target c++11 } } > > Are you sure you want a dg-do run? > > Paolo. > > Index: gcc/cp/pt.c === --- gcc/cp/pt.c (revision 271709) +++ gcc/cp/pt.c (working copy) @@ -26836,7 +26836,7 @@ static tree listify_autos (tree type, tree auto_node) { - tree init_auto = listify (auto_node); + tree init_auto = listify (strip_top_quals(auto_node)); tree argvec = make_tree_vec (1); TREE_VEC_ELT (argvec, 0) = init_auto; if (processing_template_decl) Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C === --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) @@ -0,0 +1,12 @@ +// Test for PR63149 +// { dg-do compile { target c++11 } } + +#include + +const auto r = { 1, 2, 3 }; +using X = decltype(r); +using X = const std::initializer_list; + +int main() +{ +}
Re: PR C++/63149
Hi, On 04/06/19 18:36, Nina Dinka Ranns wrote: +// Test for PR63149 +// { dg-do run { target c++11 } } Are you sure you want a dg-do run? Paolo.
PR C++/63149
Tested on Linux x86_64 2019-06-04 Nina Dinka Ranns gcc/cp PR c++/63149 * pt.c (listify_autos): use non cv qualified auto_node in std::initializer_list testsuite/ PR c++/63149 * g++.dg/cpp0x/initlist-deduce.C: New Index: gcc/cp/pt.c === --- gcc/cp/pt.c (revision 271709) +++ gcc/cp/pt.c (working copy) @@ -26836,7 +26836,7 @@ static tree listify_autos (tree type, tree auto_node) { - tree init_auto = listify (auto_node); + tree init_auto = listify (strip_top_quals(auto_node)); tree argvec = make_tree_vec (1); TREE_VEC_ELT (argvec, 0) = init_auto; if (processing_template_decl) Index: gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C === --- gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (nonexistent) +++ gcc/testsuite/g++.dg/cpp0x/initlist-deduce2.C (working copy) @@ -0,0 +1,12 @@ +// Test for PR63149 +// { dg-do run { target c++11 } } + +#include + +const auto r = { 1, 2, 3 }; +using X = decltype(r); +using X = const std::initializer_list; + +int main() +{ +}