diff options
author | Jason Merrill <jason@redhat.com> | 2011-02-20 18:18:11 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-02-20 18:18:11 -0500 |
commit | 06be49223f63ea7f3cf57146cc580fc1ee73d619 (patch) | |
tree | d82f0c11743b49ec053fa200217217430b85b57b /gcc/cp/error.c | |
parent | 525c617d3b92c10f79d1ffc786fb87dbf0958f0b (diff) | |
download | gcc-06be49223f63ea7f3cf57146cc580fc1ee73d619.zip gcc-06be49223f63ea7f3cf57146cc580fc1ee73d619.tar.gz gcc-06be49223f63ea7f3cf57146cc580fc1ee73d619.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 3e91115..28305d2 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2493,7 +2493,11 @@ location_of (tree t) if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t)) t = DECL_CONTEXT (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) t = OVL_FUNCTION (t); |