Commit 06be4922 by Jason Merrill Committed by Jason Merrill

re PR c++/47703 ([C++0x] ICE: std::sort chokes on simple lambda function)

	PR c++/47703
	* error.c (location_of): Handle non-tagged types.

From-SVN: r170349
parent 525c617d
2011-02-20 Jason Merrill <jason@redhat.com> 2011-02-20 Jason Merrill <jason@redhat.com>
PR c++/47703
* error.c (location_of): Handle non-tagged types.
PR c++/46472 PR c++/46472
* method.c (process_subob_fn): Instantiate constexpr templates. * method.c (process_subob_fn): Instantiate constexpr templates.
* optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P. * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
......
...@@ -2493,7 +2493,11 @@ location_of (tree t) ...@@ -2493,7 +2493,11 @@ location_of (tree t)
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t)) if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
t = DECL_CONTEXT (t); t = DECL_CONTEXT (t);
else if (TYPE_P (t)) else if (TYPE_P (t))
{
t = TYPE_MAIN_DECL (t); t = TYPE_MAIN_DECL (t);
if (t == NULL_TREE)
return input_location;
}
else if (TREE_CODE (t) == OVERLOAD) else if (TREE_CODE (t) == OVERLOAD)
t = OVL_FUNCTION (t); t = OVL_FUNCTION (t);
......
2011-02-20 Jason Merrill <jason@redhat.com> 2011-02-20 Jason Merrill <jason@redhat.com>
* g++.dg/overload/conv-op1.C: New.
* g++.dg/cpp0x/constexpr-synth1.C: New. * g++.dg/cpp0x/constexpr-synth1.C: New.
2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com> 2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
......
// PR c++/47703
typedef void (*pfn)(int &);
struct A
{
operator pfn() { return 0; }
};
void f()
{
const int i = 42;
A()(i); // { dg-message "<conversion>" }
}
// { dg-prune-output "no match" }
// { dg-prune-output "candidate" }
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