[LLVMbugs] [Bug 18939] New: Concatenated Objective C format string triggers Sema::CheckFormatString "String literal not of constant array type!" assert

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 23 13:33:34 PST 2014


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

            Bug ID: 18939
           Summary: Concatenated Objective C format string triggers
                    Sema::CheckFormatString "String literal not of
                    constant array type!" assert
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stephan.bergmann.secondary at googlemail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

At least on recent trunk incl. r201795 "Sema: Emit a warning for non-null
terminated format strings and other pathological cases," compiling the
Objective C code

  #import <Foundation/NSString.h>
  void test(void) { [NSString stringWithFormat: @"" @""]; }

via "clang -c test.m" fails with

  Assertion failed: (T && "String literal not of constant array type!"),
function CheckFormatString, file .../tools/clang/lib/Sema/SemaChecking.cpp,
line 3533.

Appears that such a concatenation of Objective C string literals is not of
ConstantArrayType.

-- 
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/20140223/c259bca5/attachment.html>


More information about the llvm-bugs mailing list