[LLVMbugs] [Bug 18787] New: cland: Re-declaration of a local variable inside a for-loop is allowed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 9 15:47:42 PST 2014


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

            Bug ID: 18787
           Summary: cland: Re-declaration of a local variable inside a
                    for-loop is allowed
           Product: clang
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: davide.italiano at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The previous snippet builds fine while I would expect something like
"redeclaration of i without linkage".

[code]
#include <stdio.h>

int
main(void)
{
    int i;

    for (int i = 0; i < 100; ++i) { }

    return (0);
}
[/code]

Environment:

$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.1
Thread model: posix

$ uname -a
Darwin Davides-MacBook-Pro.local 13.0.1 Darwin Kernel Version 13.0.1: Thu Sep
19 19:30:57 PDT 2013; root:xnu-2422.50.20~2/RELEASE_X86_64 x86_64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140209/d92fb8ae/attachment.html>


More information about the llvm-bugs mailing list