[llvm-bugs] [Bug 38992] New: Crash on ill-formed deduction guide in c++17 mode

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 18 19:27:35 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38992

            Bug ID: 38992
           Summary: Crash on ill-formed deduction guide in c++17 mode
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: llvm-bugs at lists.llvm.org

$ cat crash.cc
template < int > class b {};
struct S {
  b();
};

$ clang -std=c++17 crash.cc
crash.cc:3:3: error: deduction guide must be declared in the same scope as
      template 'b'
  b();
  ^
crash.cc:1:24: note: template is declared here
template < int > class b {};
                       ^
crash.cc:3:3: error: deduction guide declaration without trailing return type
  b();
  ^
crash.cc:3:3: error: deduction guide has different access from the
corresponding
      member template
crash.cc:1:1: note: member template declared (null) here
template < int > class b {};
^
Stack dump:
...
#4 clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Expr*, clang::VirtSpecifiers const&, clang::InClassInitStyle)
#5 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) 
#6
clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&,
clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType,
clang::Decl*) 
#7 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) 
#8 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
#9 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)

-- 
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/20180919/a2698659/attachment.html>


More information about the llvm-bugs mailing list