Commit 25d446fd by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/80979 (ice in lookup_mark, at cp/tree.c:2298)

	PR c++/80979
	* name-lookup.c (adl_class_only): Don't add visible friends.

From-SVN: r248922
parent 4ebcc903
2017-06-06 Nathan Sidwell <nathan@acm.org>
PR c++/80979
* name-lookup.c (adl_class_only): Don't add visible friends.
2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_base_specifier): Fix typos in error messages.
......
......@@ -801,6 +801,12 @@ name_lookup::adl_class_only (tree type)
if (CP_DECL_CONTEXT (fn) != context)
continue;
/* Only interested in anticipated friends. (Non-anticipated
ones will have been inserted during the namespace
adl.) */
if (!DECL_ANTICIPATED (fn))
continue;
/* Template specializations are never found by name lookup.
(Templates themselves can be found, but not template
specializations.) */
......
// pr C++/80979 ICE with late discovery of using directives during ADL
// of a friend declaration.
namespace Tiny {
class Handsome {};
void Dahl (Handsome &, Handsome &);
namespace Jack {
class Vladof {
friend void Dahl (Vladof &, Vladof &);
};
void Dahl (Vladof &, Vladof &);
}
struct BDonk {};
namespace Tina {
void Dahl (BDonk &, Jack::Vladof &);
}
using Tina::Dahl;
}
void BoomBoom (Tiny::BDonk &vault, Tiny::Jack::Vladof &hunter)
{
Dahl (vault, hunter);
}
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