aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/name-lookup.cc4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing16.C17
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index 421bf2e..ce62276 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -7629,6 +7629,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;
diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing16.C b/gcc/testsuite/g++.dg/cpp0x/trailing16.C
new file mode 100644
index 0000000..4feb3f81
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing16.C
@@ -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>();
+}