This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50660] warning about pass NULL to non pointer argument happens twice for template function call


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]