[Bug c++/50660] warning about pass NULL to non pointer argument happens twice for template function call
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 7 18:21:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50660
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|WAITING |NEW
Last reconfirmed|2011-10-07 00:00:00 |
Component|other |c++
Summary|gcc repeats warnings twice |warning about pass NULL to
| |non pointer argument
| |happens twice for template
| |function call
Known to fail| |4.5.0, 4.7.0
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-10-07 18:20:51 UTC ---
Simplified testcase:
#include <cstddef>
template<typename T> int f(T&);
int main(void)
{
return f<const int>(NULL);
}
--- CUT ---
t.cc: In function ‘int main()’:
t.cc:6:27: warning: passing NULL to non-pointer argument 1 of ‘int f(T&) [with
T = const int]’ [-Wconversion-null]
t.cc:6:27: warning: passing NULL to non-pointer argument 1 of ‘int f(T&) [with
T = const int]’ [-Wconversion-null]
It only happens with template functions too.
Confirmed.
More information about the Gcc-bugs
mailing list