https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94905
--- Comment #2 from Dr. Jürgen Sauermann <bug-apl at gnu dot org> --- I checked different g++ versions; the problem occurs in versions 9, 10, and 11 of g++ but not in version 8. I tried to shrink the code to the bare minimum but if I do so then the warning is no longer emitted. I noticed that the warning has become more verbose in g++ version 11. Before version 11 the warning said (one example of many): Shape.hh:133:18: error: ‘shape_Z.Shape::rho[axis]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (rho[r]) { volume /= rho[r]; rho[r] = sh; volume *= rho[r]; } ~~~~~^ In version g++ 11 it now says: Shape.hh: In member function ‘virtual Token Bif_F12_FORMAT::eval_B(Value_P)’: Shape.hh:133:18: error: ‘shape_Z.Shape::rho[<unknown>]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 133 | if (rho[r]) { volume /= rho[r]; rho[r] = sh; volume *= rho[r]; } | ~~~~~^ The <unknown> in shape_Z.Shape::rho[<unknown>] above is the function argument 'axis' of the function set_shape_item(axis, length) inside which the warning is being issued. This suggests that the warning is issued whenever the compiler is unable to statically determine if some function argument (the vector index 'axiss' in this case) is inside or outside the initialized region of a vector. This seems to be overly picky; I would normally assume that the data members of a class are always initialized. If not then the constructor and not any member function should emit a warning. Thanks for your attention and for gcc/g++ Jürgen Sauermann