===================================================================
@@ -4062,7 +4062,8 @@ more_aggr_init_expr_args_p (const aggr_init_expr_a
instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
a DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. */
#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
- (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
+ (DECL_FRIEND_P (STRIP_TEMPLATE (DECL)) && DECL_TEMPLATE_INFO (DECL) \
+ && !DECL_USE_TEMPLATE (DECL))
/* Nonzero if DECL is a function generated from a function 'temploid',
i.e. template, member of class template, or dependent friend. */
===================================================================
@@ -10,7 +10,7 @@ struct x {typedef int type;};
int main()
{
- if (strcmp (foo(x(), 3), "const char* foo(T, typename T::type) "
+ if (strcmp (foo(x(), 3), "const char* foo<T>(T, typename T::type) "
"[with T = x; typename T::type = int]") == 0)
return 0;
else
===================================================================
@@ -60,8 +60,8 @@ __assert_fail (const char *cond, const char *file,
abort ();
}
-// { dg-final { scan-assembler "int bar\\(T\\).*with T = int" } }
+// { dg-final { scan-assembler "int bar\\<T\\>\\(T\\).*with T = int" } }
// { dg-final { scan-assembler "top level" } }
// { dg-final { scan-assembler "int main\\(\\)" } }
-// { dg-final { scan-assembler "int bar\\(T\\).*with T = double" } }
-// { dg-final { scan-assembler "int bar\\(T\\).*with T = unsigned char\*" } }
+// { dg-final { scan-assembler "int bar\\<T\\>\\(T\\).*with T = double" } }
+// { dg-final { scan-assembler "int bar\\<T\\>\\(T\\).*with T = unsigned char\*" } }
===================================================================
@@ -0,0 +1,19 @@
+// PR c++/39813
+// { dg-do run }
+
+extern "C" int strcmp(const char*, const char*);
+
+struct B
+{
+ template <typename T>
+ const char* fn() { return __PRETTY_FUNCTION__; }
+};
+
+int main()
+{
+ if (strcmp (B().fn<int>(),
+ "const char* B::fn<T>() [with T = int]") == 0)
+ return 0;
+ else
+ return 1;
+}
===================================================================
@@ -14,7 +14,7 @@ template<class T> void A::f()
struct B
{
void g() {}
- static int x; // { dg-error "static.*int A::f\\(\\)::B::x" "" }
+ static int x; // { dg-error "static.*int A::f\\<T\\>\\(\\)::B::x" "" }
};
}
===================================================================
@@ -7,5 +7,5 @@ class A {
};
class B : A {
template <typename>
- void foo (); // { dg-warning "by .B::foo\\(\\)." }
+ void foo (); // { dg-warning "by .B::foo\\< \\<template-parameter-1-1\\> \\>\\(\\)." }
};
===================================================================
@@ -20,7 +20,7 @@ template<class T> void f1 (T)
if (strcmp (function, "f1"))
bad = true;
- if (strcmp (pretty, "void f1(T) [with T = float]")) // only for float instantiation
+ if (strcmp (pretty, "void f1<T>(T) [with T = float]")) // only for float instantiation
bad = true;
}
===================================================================
@@ -19,7 +19,7 @@ const char* S3<char>::h(int) { return __PRETTY_FUN
int main()
{
if (strcmp (S3<double>::h(7),
- "static const char* S3<T>::h(U) [with U = int; T = double]") == 0)
+ "static const char* S3<T>::h<U>(U) [with U = int; T = double]") == 0)
return 0;
else
return 1;