<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 --- - Clang crashes on ill-formed template code"
   href="http://llvm.org/bugs/show_bug.cgi?id=20478">20478</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crashes on ill-formed template code
          </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>rtrieu@google.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>$ cat var.cc
template<class T>
struct Foo {};

struct S {
  static Foo<Bar<int>::type>> test();
};
$clang var.cc
var.cc:5:14: error: use of undeclared identifier 'Bar'
  static Foo<Bar<int>::type>> test();
             ^
var.cc:5:21: error: expected '(' for function-style cast or type construction
  static Foo<Bar<int>::type>> test();
                 ~~~^
var.cc:5:24: error: non-friend class member 'type' cannot have a qualified name
  static Foo<Bar<int>::type>> test();
                     ~~^
var.cc:5:24: error: no member named 'type' in the global namespace
  static Foo<Bar<int>::type>> test();
                     ~~^
0  clang-3.5       0x00000000010e6fd5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  clang-3.5       0x00000000010e7423
2  libpthread.so.0 0x00007fa6d8f86cb0
3  clang-3.5       0x0000000001b3a1dc
clang::Sema::FinalizeDeclaration(clang::Decl*) + 204
4  clang-3.5       0x0000000001928ee0
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 7376
5  clang-3.5       0x00000000019256b0
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3360
6  clang-3.5       0x0000000001923efd
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7853
7  clang-3.5       0x0000000001909db9
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 1577
8  clang-3.5       0x00000000018fbab0
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 64
9  clang-3.5       0x00000000018fb860
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 384
10 clang-3.5       0x00000000018fabec
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3500
11 clang-3.5       0x00000000018f9db4
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 388
12 clang-3.5       0x00000000018f5e96 clang::ParseAST(clang::Sema&, bool, bool)
+ 406
13 clang-3.5       0x0000000001246979 clang::FrontendAction::Execute() + 57
14 clang-3.5       0x000000000121b7c3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 787
15 clang-3.5       0x00000000012b2967
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3207
16 clang-3.5       0x00000000006b3ef0 cc1_main(char const**, char const**, char
const*, void*) + 672
17 clang-3.5       0x00000000006b2140 main + 7712
18 libc.so.6       0x00007fa6d84af76d __libc_start_main + 237
19 clang-3.5       0x00000000006b01ed</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>