<html>
    <head>
      <base href="http://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 --- - isa<FunctionDecl>(nullptr) called inside Sema::FinalizeDeclaration on invalid"
   href="http://llvm.org/bugs/show_bug.cgi?id=20564">20564</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>isa<FunctionDecl>(nullptr) called inside Sema::FinalizeDeclaration on invalid
          </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>All
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nlewycky@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Testcase:

struct {
  static ::_S_destroy {

Crash:

nlewycky@ducttape:~/creduce$
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -std=gnu++11
-w -x c++ x.best
x.best:2:12: error: non-friend class member '_S_destroy' cannot have a
qualified name
  static ::_S_destroy {
         ~~^
x.best:2:12: error: C++ requires a type specifier for all declarations
  static ::_S_destroy {
  ~~~~~~   ^
x.best:2:12: error: no member named '_S_destroy' in the global namespace
  static ::_S_destroy {
         ~~^
x.best:2:24: error: expected expression
  static ::_S_destroy {
                       ^
x.best:2:24: error: expected '}'
x.best:2:23: note: to match this '{'
  static ::_S_destroy {
                      ^
clang: /usr/local/google/home/nlewycky/llvm/include/llvm/Support/Casting.h:95:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::FunctionDecl; From = clang::DeclContext]: Assertion `Val && "isa<> used
on a null pointer"' failed.
0  clang           0x0000000003d33395 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x0000000003d33612
2  clang           0x0000000003d32f9d
3  libpthread.so.0 0x00007f7b97309cb0
4  libc.so.6       0x00007f7b966414f5 gsignal + 53
5  libc.so.6       0x00007f7b96644c5b abort + 379
6  libc.so.6       0x00007f7b9663a1be
7  libc.so.6       0x00007f7b9663a262
8  clang           0x000000000117a92b
9  clang           0x0000000001155a7c
10 clang           0x00000000016e437d
11 clang           0x00000000016e029f
12 clang           0x00000000016df382
13 clang           0x0000000001799d2d
clang::Sema::FinalizeDeclaration(clang::Decl*) + 175
14 clang           0x000000000165a001
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 5783
15 clang           0x000000000165b3dd
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3205
16 clang           0x00000000016578d2
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7322
17 clang           0x0000000001644671
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 9095
18 clang           0x000000000162d795
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 95
19 clang           0x000000000162dcce
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 174
20 clang           0x000000000162d402
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2830
21 clang           0x000000000162c8aa
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 538
22 clang           0x0000000001625bb8 clang::ParseAST(clang::Sema&, bool, bool)
+ 393
23 clang           0x00000000010e300e clang::ASTFrontendAction::ExecuteAction()
+ 322
24 clang           0x00000000010e2b43 clang::FrontendAction::Execute() + 139
25 clang           0x00000000010ad73b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 721
26 clang           0x000000000107158c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1090
27 clang           0x000000000105eebb cc1_main(char const**, char const**, char
const*, void*) + 641
28 clang           0x000000000106bdfd main + 754
29 libc.so.6       0x00007f7b9662c78d __libc_start_main + 237
30 clang           0x000000000105d4c9
Stack dump:
0.    Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -std=gnu++11
-w -x c++ x.best 
1.    <eof> parser at end of file
2.    x.best:1:1: parsing struct/union/class body
Aborted (core dumped)</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>