const DefaultArgStorage *Storage = this;
if (auto *Prev = ValueOrInherited.template dyn_cast<ParmDecl*>())
Storage = &Prev->getDefaultArgStorage();
- if (auto *C = ValueOrInherited.template dyn_cast<Chain*>())
+ if (auto *C = Storage->ValueOrInherited.template dyn_cast<Chain*>())
return C->Value;
return Storage->ValueOrInherited.template get<ArgType>();
}
template<typename T = int, int N = 3, template<typename> class K = F> int H(int a = 1);
template<typename T = int, int N = 3, template<typename> class K = F> using I = decltype(H<T, N, K>());
+template<typename T = int, int N = 3, template<typename> class K = F> struct J {};
namespace NS {
struct A {};
int pre_fg = F<int>().g<int>(); // expected-error +{{must be imported}}
// expected-note@defs.h:26 +{{here}}
+J<> pre_j; // expected-error {{must be imported}} expected-error {{too few}}
+// expected-note@defs.h:49 +{{here}}
+
// Make definitions from second module visible.
#ifdef TEXTUAL
#include "import-and-redefine.h"
// expected-error@-5 {{no matching member function}}
// expected-note@defs.h:34 {{substitution failure}}
#endif
+J<> post_j;
+template<typename T, int N, template<typename> class K> struct J;
+J<> post_j2;