[LLVMbugs] [Bug 15721] New: Three crashes on gcc cpp0x testsuite

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 11 03:18:41 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15721

            Bug ID: 15721
           Summary: Three crashes on gcc cpp0x testsuite
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: markus at trippelsdorf.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

markus at x4 gcc % cat gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C
// { dg-options "-std=c++0x" }

template<class T> struct S0 {};
template<class T> using AS0 = S0<T>;

template<template<class> class TT>
void f(TT<int>);

template class AS0<char>; // { dg-error "alias
templ\[^\n\r\]*specialization\[^\n\r\]*after\[^\n\r\]*class" }

void
foo()
{
  AS0<int> a;
  f(a);
}

template<class T, class U> struct Vector{};
template<class T> struct Alloc {};

template<class T> using Vec = Vector<T, Alloc<T> >;

template<class T> void g(Vector<T, Alloc<T> >);

template<template<class T> class TT> void h(TT<int>); // { dg-error "provided
for" }

void
bar()
{
  Vec<int> a;
  g(a);
  h(a); // { dg-error "no matching function|wrong number of template arguments"
}
}

markus at x4 gcc % clang++ -c gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C
gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C:4:31: warning: alias declarations are
a C++11 extension [-Wc++11-extensions]
template<class T> using AS0 = S0<T>;
                              ^
0  clang-3.3       0x0000000000f06602 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang-3.3       0x0000000000f06261
2  libpthread.so.0 0x00007f39cfb750c0
3  clang-3.3       0x00000000019be8fb clang::TagDecl::getDefinition() const +
91
4  clang-3.3       0x00000000013c6c85
clang::Sema::isAcceptableTagRedeclaration(clang::TagDecl const*,
clang::TagTypeKind, bool, clang::SourceLocation, clang::IdentifierInfo 
const&) + 1061
5  clang-3.3       0x000000000157acde
clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation,
clang::SourceLocation, unsigned int, clang::SourceLocation
, clang::CXXScopeSpec const&, clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::SourceLocation,
llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang
::SourceLocation, clang::AttributeList*) + 110
6  clang-3.3       0x00000000011b98dd
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo con
st&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4813
7  clang-3.3       0x00000000011a54f5
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Par
ser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4325
8  clang-3.3       0x00000000011ffc8a
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&
, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 874
9  clang-3.3       0x0000000001201396
clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation,
clang::SourceLocation, clang::SourceLocation&, clang::Acc
essSpecifier) + 150
10 clang-3.3       0x0000000001201566
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
 + 342
11 clang-3.3       0x00000000011a8c86
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttrib
utesWithRange&) + 582
12 clang-3.3       0x00000000011958ea
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 314
13 clang-3.3       0x0000000001195fa2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 194
14 clang-3.3       0x000000000118d44b clang::ParseAST(clang::Sema&, bool, bool)
+ 283
15 clang-3.3       0x00000000010de929 clang::FrontendAction::Execute() + 169
16 clang-3.3       0x00000000010c1ad5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 293
17 clang-3.3       0x0000000000f08d07
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1607
18 clang-3.3       0x00000000006a31e8 cc1_main(char const**, char const**, char
const*, void*) + 872
19 clang-3.3       0x000000000068ed40 main + 8032
20 libc.so.6       0x00007f39cf592875 __libc_start_main + 245
21 clang-3.3       0x00000000006a1135
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.3 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name alias-dec
l-2.C -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-point
er -coverage-file /home/markus/gcc/alias-decl-2.o -resource-dir
/usr/local/bin/../lib/clang/3.3 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4 -int
ernal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/backward -
internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdepr
ecated-macro -fdebug-compilation-dir /home/markus/gcc -ferror-limit 19
-fmessage-length 174 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-excep
tions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o alias-decl-2.o -x c++
gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C 
1.      gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C:9:25: current parser token
';'
clang-3.3: error: unable to execute command: Segmentation fault
clang-3.3: error: clang frontend command failed due to signal (use -v to see
invocation)


markus at x4 gcc % cat gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
// { dg-options "-std=c++0x" }

template <class T> using Ptr = T*;
Ptr<unsigned>; // { dg-error "does not declare anything" }
Ptr<char><int>; // { dg-error "not a template|does not declare anything" }
template class Ptr<int>;//{ dg-error "alias template
specialization\[^\n\r\]*after\[^\n\r\]*class" }

template <class T> using Arg = T;
struct A {};
template class Arg<A>;// { dg-error "alias
templ\[^\n\r\]*specialization\[^\n\r\]*Arg<A>\[^\n\r\]*after\[^\n\r\]*class" }

template <template <class> class TT, class T> using Instantiate = TT<T>;
template <class> struct Vector {};

// The below is not OK, because of [dcl.type.elab]:
// 
//     If the identifier resolves to a typedef-name or the
//     simple-template-id resolves to an alias template
//     specialization, the elaborated-type-specifier is ill-formed.
//
template class Instantiate<Vector, int>;//{ dg-error "alias template
specialization\[^\n\r\]*after\[^\n\r\]*class" }

template <class T> struct S {};
template<class T> using SFor = S<T>;
// Likewise, this is not OK.
template class SFor<int>; //{ dg-error "alias template
specialization\[^\n\r\]*after\[^\n\r\]*class" }


markus at x4 gcc % clang++ -c gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C:3:32: warning: alias declarations
are a C++11 extension [-Wc++11-extensions]
template <class T> using Ptr = T*;
                               ^
gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C:4:1: warning: declaration does not
declare anything [-Wmissing-declarations]
Ptr<unsigned>; // { dg-error "does not declare anything" }
^~~~~~~~~~~~~
gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C:5:10: error: expected unqualified-id
Ptr<char><int>; // { dg-error "not a template|does not declare anything" }
         ^
0  clang-3.3       0x0000000000f06602 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang-3.3       0x0000000000f06261
2  libpthread.so.0 0x00007f5b2ae9d0c0
3  clang-3.3       0x0000000000ed6fba
llvm::FoldingSetImpl::FindNodeOrInsertPos(llvm::FoldingSetNodeID const&,
void*&) + 58
4  clang-3.3       0x00000000019eb8b6
clang::ClassTemplateDecl::findSpecialization(clang::TemplateArgument const*,
unsigned int, void*&) + 150
5  clang-3.3       0x000000000157b01d
clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation,
clang::SourceLocation, unsigned int, clang::SourceLocation
, clang::CXXScopeSpec const&, clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::SourceLocation,
llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang
::SourceLocation, clang::AttributeList*) + 941
6  clang-3.3       0x00000000011b98dd
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo con
st&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4813
7  clang-3.3       0x00000000011a54f5
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Par
ser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4325
8  clang-3.3       0x00000000011ffc8a
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&
, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 874
9  clang-3.3       0x0000000001201396
clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation,
clang::SourceLocation, clang::SourceLocation&, clang::Acc
essSpecifier) + 150
10 clang-3.3       0x0000000001201566
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
 + 342
11 clang-3.3       0x00000000011a8c86
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttrib
utesWithRange&) + 582
12 clang-3.3       0x00000000011958ea
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 314
13 clang-3.3       0x0000000001195fa2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 194
14 clang-3.3       0x000000000118d44b clang::ParseAST(clang::Sema&, bool, bool)
+ 283
15 clang-3.3       0x00000000010de929 clang::FrontendAction::Execute() + 169
16 clang-3.3       0x00000000010c1ad5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 293
17 clang-3.3       0x0000000000f08d07
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1607
18 clang-3.3       0x00000000006a31e8 cc1_main(char const**, char const**, char
const*, void*) + 872
19 clang-3.3       0x000000000068ed40 main + 8032
20 libc.so.6       0x00007f5b2a8ba875 __libc_start_main + 245
21 clang-3.3       0x00000000006a1135
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.3 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name alias-dec
l-10.C -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-poin
ter -coverage-file /home/markus/gcc/alias-decl-10.o -resource-dir
/usr/local/bin/../lib/clang/3.3 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4 -i
nternal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/backward
 -internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fde
precated-macro -fdebug-compilation-dir /home/markus/gcc -ferror-limit 19
-fmessage-length 174 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-exc
eptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o alias-decl-10.o -x c++
gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C 
1.      gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C:6:24: current parser token
';'
clang-3.3: error: unable to execute command: Segmentation fault
clang-3.3: error: clang frontend command failed due to signal (use -v to see
invocation)


markus at x4 gcc % cat gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C
// { dg-do compile { target c++11 } }

struct A                        // { dg-error "non-static data member" }
{
  int i = (A(), 42);            // { dg-message "required here" }
};

A a;

markus at x4 gcc % clang++ -c -std=c++11 gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C
gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C:5:12: error: defaulted default
constructor of 'A' cannot be used by non-static data member initializer which
appears before end of
      class definition
  int i = (A(), 42);            // { dg-message "required here" }
           ^
0  clang-3.3       0x0000000000f06602 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang-3.3       0x0000000000f06261
2  libpthread.so.0 0x00007f959dc1f0c0
3  clang-3.3       0x0000000001a09f1e
4  clang-3.3       0x0000000001a130da
5  clang-3.3       0x000000000067eb57
6  clang-3.3       0x0000000001a0948f
7  clang-3.3       0x0000000001a0e9b2
8  clang-3.3       0x0000000001a162b0
9  clang-3.3       0x0000000001a17f6a
10 clang-3.3       0x0000000001a185b2
11 clang-3.3       0x0000000001a0e3e0
12 clang-3.3       0x0000000001a10022
13 clang-3.3       0x0000000001a11c54
clang::Expr::EvaluateForOverflow(clang::ASTContext const&,
llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >*) const + 324
14 clang-3.3       0x0000000001370b34
clang::Sema::CheckForIntOverflow(clang::Expr*) + 84
15 clang-3.3       0x00000000014c1762
clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool,
bool) + 178
16 clang-3.3       0x0000000001418add
clang::Sema::ActOnCXXInClassMemberInitializer(clang::Decl*,
clang::SourceLocation, clang::Expr*) + 141
17 clang-3.3       0x0000000001208f59
clang::Parser::ParseLexedMemberInitializer(clang::Parser::LateParsedMemberInitializer&)
+ 521
18 clang-3.3       0x0000000001208c79
clang::Parser::ParseLexedMemberInitializers(clang::Parser::ParsingClass&) + 233
19 clang-3.3       0x00000000011b7933
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1443
20 clang-3.3       0x00000000011b945b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 3659
21 clang-3.3       0x00000000011a54f5
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4325
22 clang-3.3       0x0000000001191bb4
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 84
23 clang-3.3       0x000000000119245e
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 958
24 clang-3.3       0x00000000011958a9
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 249
25 clang-3.3       0x0000000001195fa2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 194
26 clang-3.3       0x000000000118d490 clang::ParseAST(clang::Sema&, bool, bool)
+ 352
27 clang-3.3       0x00000000010de929 clang::FrontendAction::Execute() + 169
28 clang-3.3       0x00000000010c1ad5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 293
29 clang-3.3       0x0000000000f08d07
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1607
30 clang-3.3       0x00000000006a31e8 cc1_main(char const**, char const**, char
const*, void*) + 872
31 clang-3.3       0x000000000068ed40 main + 8032
32 libc.so.6       0x00007f959d63c875 __libc_start_main + 245
33 clang-3.3       0x00000000006a1135
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.3 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name nsdmi-defer6.C -mrelocation-model static
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-coverage-file /home/markus/gcc/nsdmi-defer6.o -resource-dir
/usr/local/bin/../lib/clang/3.3 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/markus/gcc -ferror-limit 19 -fmessage-length 174
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o nsdmi-defer6.o -x c++
gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C 
1.      <eof> parser at end of file
2.      gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C:3:1: parsing
struct/union/class body 'A'
clang-3.3: error: unable to execute command: Segmentation fault
clang-3.3: error: clang frontend command failed due to signal (use -v to see
invocation)

-- 
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/20130411/d6c2a006/attachment.html>


More information about the llvm-bugs mailing list