[LLVMbugs] [Bug 14168] New: Pre-increment operator not working for variable.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 24 01:05:55 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14168

             Bug #: 14168
           Summary: Pre-increment operator not working for variable.
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rahul.s1 at samsung.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


In the below test case, the value of i not incremented after call to va_arg:

#include <stdarg.h>

extern void exit (int);
extern void abort (void);

int a[10];
int i = 9;

void
f (int n, ...)
{
  va_list ap;
  va_start (ap, n);
  va_arg (ap, typeof(int (*)[++i]));
  if (i != n)
    abort ();
  va_end (ap);

  }

int
main (void)
{
  f (10, &a);
  exit (0);
}




Further , on modifying the TC to :


int a[1];
int main()
{
 int i = 0;

 a[0] = 1;
 typeof(int (*)[++i]) a1 = &a;
}


i is getting properly incremented.

Is their any how , clang is bypassing the increment of i in the 1st case.

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