Commit 7cdd2e6c by Ed Smith-Rowland Committed by Jason Merrill

re PR c++/51420 ([c++0x] ICE with invalid user-defined literals)

	PR c++/51420
	* parser.c (lookup_literal_operator): Check that declaration is an
	overloaded function.

From-SVN: r182083
parent 543dfd37
2011-12-07 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/51420
* parser.c (lookup_literal_operator): Check that declaration is an
overloaded function.
2011-12-06 Jakub Jelinek <jakub@redhat.com>
PR c++/51430
......
......@@ -3554,7 +3554,7 @@ lookup_literal_operator (tree name, VEC(tree,gc) *args)
{
tree decl, fns;
decl = lookup_name (name);
if (!decl || decl == error_mark_node)
if (!decl || !is_overloaded_fn (decl))
return error_mark_node;
for (fns = decl; fns; fns = OVL_NEXT (fns))
......
2011-12-07 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/51420
* g++.dg/cpp0x/pr51420.C: New.
2011-12-07 Richard Guenther <rguenther@suse.de>
PR lto/48100
......
// { dg-options "-std=c++11" }
void
foo()
{
float x = operator"" _F(); // { dg-error "was not declared in this scope" }
float y = 0_F; // { dg-error "unable to find numeric literal operator" }
}
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