Commit db4c7adf authored by Richard Smith's avatar Richard Smith
Browse files

Suppress false-positive -Wuninitialized warnings in the constructor of a

templated but non-template class.
parent 70d14255
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3807,7 +3807,7 @@ namespace {
    const CXXRecordDecl *RD = Constructor->getParent();
    if (RD->getDescribedClassTemplate())
    if (RD->isDependentContext())
      return;
    // Holds fields that are uninitialized.
+9 −0
Original line number Diff line number Diff line
@@ -1449,3 +1449,12 @@ void if_switch_init_stmt(int k) {

  switch (int n; (n == k || k > 5)) {} // expected-warning {{uninitialized}} expected-note {{initialize}} expected-warning {{boolean}}
}

template<typename T> struct Outer {
  struct Inner {
    int a = 1;
    int b;
    Inner() : b(a) {}
  };
};
Outer<int>::Inner outerinner;