The code had a typo it was doing:
Param->setUninstantiatedDefaultArg(Param->getUninstantiatedDefaultArg());
This is a no-op but may assert, we wanted to do:
Param->setUninstantiatedDefaultArg(OldParam->getUninstantiatedDefaultArg());
This fixes PR28082.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272425
91177308-0d34-0410-b5e6-
96231b3b80d8
assert (!OldParam->hasUnparsedDefaultArg());
if (OldParam->hasUninstantiatedDefaultArg())
Param->setUninstantiatedDefaultArg(
- Param->getUninstantiatedDefaultArg());
+ OldParam->getUninstantiatedDefaultArg());
else
Param->setDefaultArg(OldParam->getInit());
}
// here.
template struct A<int>;
}
+
+namespace PR28082 {
+struct S {
+ template <int>
+ int f(int = 0);
+ template <>
+ int f<0>(int); // expected-warning {{Microsoft extension}}
+};
+}