mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-18 08:23:50 +08:00
c++: class scope function lookup [PR105908]
In r12-1273 for PR91706, I removed the code in get_class_binding that stripped BASELINK. This testcase demonstrates that we still need to strip it in outer_binding before putting the overload set in IDENTIFIER_BINDING, for compatibility with bindings added directly for declarations. PR c++/105908 gcc/cp/ChangeLog: * name-lookup.cc (outer_binding): Strip BASELINK. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/trailing16.C: New test.
This commit is contained in:
parent
bb1a6d9298
commit
4fcf79c8ab
@ -7626,6 +7626,10 @@ outer_binding (tree name,
|
||||
/* Thread this new class-scope binding onto the
|
||||
IDENTIFIER_BINDING list so that future lookups
|
||||
find it quickly. */
|
||||
if (BASELINK_P (class_binding->value))
|
||||
/* Don't put a BASELINK in IDENTIFIER_BINDING. */
|
||||
class_binding->value
|
||||
= BASELINK_FUNCTIONS (class_binding->value);
|
||||
class_binding->previous = outer;
|
||||
if (binding)
|
||||
binding->previous = class_binding;
|
||||
|
17
gcc/testsuite/g++.dg/cpp0x/trailing16.C
Normal file
17
gcc/testsuite/g++.dg/cpp0x/trailing16.C
Normal file
@ -0,0 +1,17 @@
|
||||
// PR c++/105908
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct test
|
||||
{
|
||||
template <typename T>
|
||||
int templated_func();
|
||||
|
||||
template <typename T>
|
||||
auto call_templated_func() -> decltype(templated_func<T>());
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
auto test::call_templated_func() -> decltype(templated_func<T>())
|
||||
{
|
||||
return templated_func<T>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user