Commit 9a3970dd by Jason Merrill Committed by Jason Merrill

re PR c++/57532 (operator& broken when used on rvalues)

	PR c++/57532
	* parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
	a ref-qualifier in C++98 mode.

From-SVN: r200842
parent cb5f47b6
2013-07-09 Jason Merrill <jason@redhat.com> 2013-07-09 Jason Merrill <jason@redhat.com>
PR c++/57532
* parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
a ref-qualifier in C++98 mode.
PR c++/57545 PR c++/57545
* pt.c (convert_nontype_argument) [INTEGER_CST]: Force the * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
argument to have the exact type of the parameter. argument to have the exact type of the parameter.
......
...@@ -17374,6 +17374,10 @@ cp_parser_ref_qualifier_opt (cp_parser* parser) ...@@ -17374,6 +17374,10 @@ cp_parser_ref_qualifier_opt (cp_parser* parser)
{ {
cp_ref_qualifier ref_qual = REF_QUAL_NONE; cp_ref_qualifier ref_qual = REF_QUAL_NONE;
/* Don't try to parse bitwise '&' as a ref-qualifier (c++/57532). */
if (cxx_dialect < cxx11 && cp_parser_parsing_tentatively (parser))
return ref_qual;
while (true) while (true)
{ {
cp_ref_qualifier curr_ref_qual = REF_QUAL_NONE; cp_ref_qualifier curr_ref_qual = REF_QUAL_NONE;
......
// PR c++/57532
int main()
{
return (int() & int());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment