// gcc-bug: attribute((sentinel)) warning does not trigger for member function template // // how to reproduce: g++-4.1.1 -Wall -c test.cpp // Markus F.X.J. Oberhumer <[EMAIL PROTECTED]>
#define SENTINEL __attribute__((__sentinel__)) void func1(const char *, ...) SENTINEL; template <class T> void func2(const T *, ...) SENTINEL; static void func3(const char *, ...) SENTINEL; template <class T> static void func4(const T *, ...) SENTINEL; struct C { void func1(const char *, ...) SENTINEL; template <class T> void func2(const T *, ...) SENTINEL; static void func3(const char *, ...) SENTINEL; template <class T> static void func4(const T *, ...) SENTINEL; }; static void func3(const char *, ...) { } // definition void foo(C &c) { func1("a", "b"); // warning here func2("a", "b"); // warning here func3("a", "b"); // warning here func4("a", "b"); // warning here c.func1("a", "b"); // warning here c.func2("a", "b"); // NO warning here ! c.func3("a", "b"); // warning here c.func4("a", "b"); // NO warning here ! } -- Summary: attribute((sentinel)) warning does not trigger for member function template Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: markus at oberhumer dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29823