<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion failure parsing block expressions with nonnull attributes"
   href="https://llvm.org/bugs/show_bug.cgi?id=23117">23117</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure parsing block expressions with nonnull attributes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>thonermann@coverity.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>An assertion failure occurs in Clang 3.5 through trunk (r234011) when a nonnull
attribute appears on a Block expression.  Clang 3.4 issues a warning for these
cases.  The check for a non-function declaration that previously resulted in
the warning was removed in r199387.

$ cat t.c
void(^bp1)(int *) = ^(int *p1) __attribute__((nonnull(1))) {};

$ clang-trunk --version
clang version 3.7.0 (trunk 234011)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang-trunk -c -fblocks t.c
clang:
/nfs/thonermann/src/llvm-trunk/tools/clang/lib/Sema/SemaDeclAttr.cpp:260: bool
checkFunctionOrMethodParameterIndex(clang::Sema &, const clang::Decl *, const
clang::AttributeList &, unsigned int, const clang::Expr *, uint64_t &):
Assertion `isFunctionOrMethod(D)' failed.
...

$ clang-3.4 --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang-3.4 -c -fblocks t.c
t.c:1:47: warning: 'nonnull' attribute only applies to functions
[-Wignored-attributes]
void(^bp1)(int *) = ^(int *p1) __attribute__((nonnull(1))) {};
                                              ^
1 warning generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>