When instantiating a member function declared via a typedef, don't try
to enter the instantiated parameter declarations into the local
instantiation scope; they can't be referenced anyway. Fixes PR7022.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102914 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-method.cpp b/test/SemaTemplate/instantiate-method.cpp
index c0325cf..363115d 100644
--- a/test/SemaTemplate/instantiate-method.cpp
+++ b/test/SemaTemplate/instantiate-method.cpp
@@ -152,3 +152,26 @@
}
}
+
+namespace PR7022 {
+ template <typename >
+ struct X1
+ {
+ typedef int state_t( );
+ state_t g ;
+ };
+
+ template < typename U = X1<int> > struct X2
+ {
+ X2( U = U())
+ {
+ }
+ };
+
+ void m(void)
+ {
+ typedef X2<> X2_type;
+ X2_type c;
+ }
+
+}