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++/29823] New: attribute((sentinel)) warning does not trigger for member function template


// 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


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