[LLVMbugs] [Bug 8712] New: value dependent member in class template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 1 02:11:57 PST 2010


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

           Summary: value dependent member in class template
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timoskrempel at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following code works an compiles in 2.8 but compilation fails in trunk (rev
120287):

template <int dim>
class B
{
  public:
    B(const unsigned char i);
    unsigned char value : (dim > 0 ? dim : 1);
};

template <int dim>
inline
B<dim>::B(const unsigned char i)
        : value(i)
{}

int main()
{}

with the following error:

$ clang++ bug3.cc
clang: ExprConstant.cpp:2458: <unnamed>::ICEDiag CheckICE(const clang::Expr*,
clang::ASTContext&): Assertion `!E->isValueDependent() && "Should not see value
dependent exprs!"' failed.
0  clang           0x00000000016971cf
1  clang           0x0000000001699442
2  libpthread.so.0 0x00007fcf772f8b40
3  libc.so.6       0x00007fcf765f6ba5 gsignal + 53
4  libc.so.6       0x00007fcf765fa6b0 abort + 384
5  libc.so.6       0x00007fcf765efa71 __assert_fail + 241
6  clang           0x0000000000c8ecb9
7  clang           0x0000000000c8edef
clang::Expr::isIntegerConstantExpr(llvm::APSInt&, clang::ASTContext&,
clang::SourceLocation*, bool) const + 63
8  clang           0x00000000008e13cc
9  clang           0x00000000009e2cad
clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity
const&, clang::InitializationKind const&, clang::ASTMultiPtr<clang::Expr*>,
clang::QualType*) + 301
10 clang           0x0000000000952a68
clang::Sema::BuildMemberInitializer(clang::FieldDecl*, clang::Expr**, unsigned
int, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation) + 712
11 clang           0x0000000000968f59
clang::Sema::ActOnMemInitializer(clang::Decl*, clang::Scope*,
clang::CXXScopeSpec&, clang::IdentifierInfo*,
clang::OpaquePtr<clang::QualType>, clang::SourceLocation,
clang::SourceLocation, clang::Expr**, unsigned int, clang::SourceLocation) +
697
12 clang           0x000000000089c44e
clang::Parser::ParseMemInitializer(clang::Decl*) + 750
13 clang           0x000000000089c5e5
clang::Parser::ParseConstructorInitializer(clang::Decl*) + 213
14 clang           0x000000000088bd4b
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 555
15 clang           0x00000000008b6e9e
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 2382
16 clang           0x00000000008b9305
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 693
17 clang           0x0000000000896929
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 409
18 clang           0x000000000088ccd3
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList,
clang::Parser::ParsingDeclSpec*) + 1091
19 clang           0x000000000088cf12
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 114
20 clang           0x000000000087541b clang::ParseAST(clang::Sema&, bool) + 139
21 clang           0x0000000000747b34 clang::CodeGenAction::ExecuteAction() +
68
22 clang           0x0000000000641c75
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
23 clang           0x00000000006219ec
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1260
24 clang           0x0000000000619775 cc1_main(char const**, char const**, char
const*, void*) + 693
25 clang           0x0000000000620965 main + 4181
26 libc.so.6       0x00007fcf765e1d8e __libc_start_main + 254
27 clang           0x0000000000617e89
Stack dump:
0.    Program arguments: /scratch/kram/llvm/Release+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name bug3.cc -mrelocation-model static -mdisable-fp-elim
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.20.51 -resource-dir
/scratch/kram/llvm/Release+Asserts/bin/../lib/clang/2.9 -ferror-limit 19
-fmessage-length 165 -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-BRMnQS.o -x c++ bug3.cc 
1.    bug3.cc:13:1: current parser token '{'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list