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

             Bug #: 12661
           Summary: clang fails to detect invalid application of "sizeof"
                    to an incomplete type when there is a complete type in
                    different scope
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 8452
  --> http://llvm.org/bugs/attachment.cgi?id=8452
test case

Clang accepts the following erroneous code:

void bar(int);
int foo()
{
  extern int arr[];
  { extern int arr[10]; }
  bar(sizeof(arr)); /* should raise error here */
  return 0;
}

GCC will report the error:
size_of_incomp.c: In function 'foo':
size_of_incomp.c:6: error: invalid application of 'sizeof' to incomplete type
'int[]'

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to