[LLVMbugs] [Bug 6485] New: Diagnostic for using non-POD type with va_start needs improvement

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 3 15:01:53 PST 2010


           Summary: Diagnostic for using non-POD type with va_start needs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rideau3 at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

coppro at overthere:~$ clang -x c++ -
#include <stdarg.h>               

struct foo { virtual void bar(); };

void baz (foo f, ...) {
  va_list v;
  va_start(v, f);
<stdin>:7:3: error: cannot pass object of non-POD type 'struct foo' through
variadic function; call will abort at runtime [-Wnon-pod-varargs]
  va_start(v, f);
<stdin>:7:15: note: instantiated from:
  va_start(v, f);
1 diagnostic generated.

GCC does not issue a diagnostic here, however, it is good that clang do so
([support.runtime]/3). The diagnostic could bear improvement, however - prehaps
to something along the lines of "cannot use va_start on a parameter of non-POD
type 'struct foo'".

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list