diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-01 16:24:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-01 16:24:08 -0400 |
commit | a771bf1cf6a6d6f785f5b6f714e9d732ccfcc757 (patch) | |
tree | 935a2f707de091eaf2ce92a9f6731bae86f400f5 | |
parent | 985b34c77a44612cecf8c8a73bfa8224699b9855 (diff) | |
download | gcc-a771bf1cf6a6d6f785f5b6f714e9d732ccfcc757.zip gcc-a771bf1cf6a6d6f785f5b6f714e9d732ccfcc757.tar.gz gcc-a771bf1cf6a6d6f785f5b6f714e9d732ccfcc757.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/explicit-args4.C | 14 |
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 842d049..ac7eddd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 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 * semantics.c (finish_offsetof): Complain about incomplete type. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4903044..947e19e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14679,6 +14679,7 @@ resolve_nondeduced_context (tree orig_expr) } if (good == 1) { + mark_used (goodfn); expr = goodfn; if (baselink) expr = build_baselink (BASELINK_BINFO (baselink), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f2053a..903e0fb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2011-07-01 Jason Merrill <jason@redhat.com> + PR c++/48883 + * g++.dg/template/explicit-args4.C: New. + PR c++/49085 * g++.dg/template/offsetof2.C: New. diff --git a/gcc/testsuite/g++.dg/template/explicit-args4.C b/gcc/testsuite/g++.dg/template/explicit-args4.C new file mode 100644 index 0000000..c64a085 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/explicit-args4.C @@ -0,0 +1,14 @@ +// 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 */ +} |