Commit a771bf1c by Jason Merrill Committed by Jason Merrill

re PR c++/48883 (?: ternary operator fails in certain contexts - link error)

	PR c++/48883
	PR c++/49609
	* pt.c (resolve_nondeduced_context): Call mark_used.

From-SVN: r175764
parent 985b34c7
2011-07-01 Jason Merrill <jason@redhat.com> 2011-07-01 Jason Merrill <jason@redhat.com>
PR c++/48883
PR c++/49609
* pt.c (resolve_nondeduced_context): Call mark_used.
PR c++/49085 PR c++/49085
* semantics.c (finish_offsetof): Complain about incomplete type. * semantics.c (finish_offsetof): Complain about incomplete type.
......
...@@ -14679,6 +14679,7 @@ resolve_nondeduced_context (tree orig_expr) ...@@ -14679,6 +14679,7 @@ resolve_nondeduced_context (tree orig_expr)
} }
if (good == 1) if (good == 1)
{ {
mark_used (goodfn);
expr = goodfn; expr = goodfn;
if (baselink) if (baselink)
expr = build_baselink (BASELINK_BINFO (baselink), expr = build_baselink (BASELINK_BINFO (baselink),
......
2011-07-01 Jason Merrill <jason@redhat.com> 2011-07-01 Jason Merrill <jason@redhat.com>
PR c++/48883
* g++.dg/template/explicit-args4.C: New.
PR c++/49085 PR c++/49085
* g++.dg/template/offsetof2.C: New. * g++.dg/template/offsetof2.C: New.
......
// PR c++/48883
// { dg-do link }
template<typename T>
T myMax(T a, T b) {
if(a < b) return a;
return b;
}
int main() {
bool even = true;
int (*fp)(int, int);
fp = even ? myMax<int> : myMax<int>; /* yields link error */
}
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