Unfortunately, gcc does not have the ability to disable warnings for specific lines. In any case, if you do this, you should simply rename your constructor info parameter to my_info and the shadow will disappear.
The best advice I can give you is to work on removing all of these warnings, even if you don’t care. In general, it is best not to use parameter names that hide member functions.
This is the approach we took to incorporate new warnings and introduce other static checkers. In my opinion, pain generally wins.
In some cases, we managed to run the script by code to make changes for us. I'm not sure how easy it is. Alternatively, a good editor (such as emacs or VIM) should help you make this type of “mechanical” change semi-automatically and fairly quickly if you can manage the editor well!
Another really hacky option is to create a list of known “good” exceptions and to deduce them from the compiler output. You can create a wrapper for gcc that simply extracts warnings you don't want to see. I do not recommend it, it may be easier to fix your code base!
Peter
source share