struct P {}; template struct O { struct I; }; template struct O::I::S : P {}; // { dg-error "" }