In the TH1::Fit method description, in the ... Warning when using the option "0" ... you "REDEFINE" the TF1::kNotDraw enum:
const Int_t kNotDraw = 1<<9;
Maybe you could remove that line and simply replace "->ResetBit(kNotDraw);" with the proper "->ResetBit(TF1::kNotDraw);" in the example code given therein.