<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 --- - Crash on invalid: Assertion failed: (Access == AS_private || Access == AS_protected)"
   href="http://llvm.org/bugs/show_bug.cgi?id=22055">22055</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash on invalid: Assertion failed: (Access == AS_private || Access == AS_protected)
          </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>nicolasweber@gmx.de
          </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>Both member functions in the follow snippet cause asserts:

class BB  {
  template <class B {}, B> void f() {}
  template <class C : C {}> void g() {}
};


$ bin/clang -c test2.cc -std=c++11 
test2.cc:2:19: error: 'BB::B' cannot be defined in a type specifier
  template <class B {}, B> void f() {}
                  ^
test2.cc:2:23: error: a non-type template parameter cannot have type 'class B'
  template <class B {}, B> void f() {}
                      ^
test2.cc:2:26: error: a non-type template parameter cannot have type 'BB::B'
  template <class B {}, B> void f() {}
                         ^
Assertion failed: (Access == AS_private || Access == AS_protected), function
HasAccess, file /Users/thakis/src/llvm-rw/tools/clang/lib/Sema/SemaAccess.cpp,
line 737.
0  clang-3.5                0x000000010b53d0c9
llvm::sys::PrintStackTrace(__sFILE*) + 57
1  clang-3.5                0x000000010b53d84b SignalHandler(int) + 635
2  libsystem_platform.dylib 0x00007fff872f7f1a _sigtramp + 26
3  clang-3.5                0x000000010d293758 guard variable for
isAllowedIDChar(unsigned int, clang::LangOptions const&)::C99AllowedIDChars +
83360
4  clang-3.5                0x000000010b53d5b6 abort + 22
5  clang-3.5                0x000000010b53d591 __assert_rtn + 81
6  clang-3.5                0x000000010c0a79f2 HasAccess(clang::Sema&,
(anonymous namespace)::EffectiveContext const&, clang::CXXRecordDecl const*,
clang::AccessSpecifier, (anonymous namespace)::AccessTarget const&) + 1746
7  clang-3.5                0x000000010c0a704d IsAccessible(clang::Sema&,
(anonymous namespace)::EffectiveContext const&, (anonymous
namespace)::AccessTarget&) + 253
8  clang-3.5                0x000000010c0a3bb7
CheckEffectiveAccess(clang::Sema&, (anonymous namespace)::EffectiveContext
const&, clang::SourceLocation, (anonymous namespace)::AccessTarget&) + 71
9  clang-3.5                0x000000010c0a38c6
clang::Sema::HandleDelayedAccessCheck(clang::sema::DelayedDiagnostic&,
clang::Decl*) + 342
10 clang-3.5                0x000000010c195f20
clang::Sema::PopParsingDeclaration(clang::Sema::DelayedDiagnosticsState,
clang::Decl*) + 512
11 clang-3.5                0x000000010beae2b8
clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier,
clang::AttributeList*, clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&,
clang::FunctionDefinitionKind, clang::ActionResult<clang::Expr*, true>&) + 600
12 clang-3.5                0x000000010bee0ee3
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 5571
13 clang-3.5                0x000000010bf359b5
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 165
14 clang-3.5                0x000000010bf355c8
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1064
15 clang-3.5                0x000000010bf34f5a
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 282
16 clang-3.5                0x000000010bedfe84
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 1380
17 clang-3.5                0x000000010bedd2ff
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3647
18 clang-3.5                0x000000010bedb9a3
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 9059
19 clang-3.5                0x000000010bebd568
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 3448
20 clang-3.5                0x000000010bf45189
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 73
21 clang-3.5                0x000000010bf44d67
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 375
22 clang-3.5                0x000000010bf43d06
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2710
23 clang-3.5                0x000000010bf43135
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 485
24 clang-3.5                0x000000010beadac7 clang::ParseAST(clang::Sema&,
bool, bool) + 247
25 clang-3.5                0x000000010bb02ffb
clang::CodeGenAction::ExecuteAction() + 123
26 clang-3.5                0x000000010b766183 clang::FrontendAction::Execute()
+ 67
27 clang-3.5                0x000000010b7379fc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 972
28 clang-3.5                0x000000010b7a66f5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4149
29 clang-3.5                0x000000010a633a4c cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1068
30 clang-3.5                0x000000010a6326fe main + 11438
31 libdyld.dylib            0x00007fff8a2cf5c9 start + 1


The LookupResult tries to do an access check since it's a lookup for a class,
but both UnprivilegedAccess and FinalAccess in IsAccessible() in SemaAccess.cpp
end up being AS_none in this case.</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>