This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29823] New: attribute((sentinel)) warning does not trigger for member function template
- From: "markus at oberhumer dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2006 03:25:40 -0000
- Subject: [Bug c++/29823] New: attribute((sentinel)) warning does not trigger for member function template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
// 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 <markus@oberhumer.com>
#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