<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 --- - Assertion failure compiling a local class member function that declares a VLA using a typedef from an enclosing scope"
href="http://llvm.org/bugs/show_bug.cgi?id=20857">20857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failure compiling a local class member function that declares a VLA using a typedef from an enclosing scope
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>thonermann@coverity.com
</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>$ cat t.cpp
extern int n;
void f() {
typedef int vla[n];
struct LS {
void mf() {
vla v;
}
};
LS ls;
ls.mf();
}
$ clang++ --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang++ -c t.cpp
clang: .../CodeGenFunction.cpp:1260: std::pair<llvm::Value*, clang::QualType>
clang::CodeGen::CodeGenFunction::getVLASize(const clang::VariableArrayType*):
Assertion `vlaSize && "no size for VLA!"' failed.
0 clang 0x0000000002607c32 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 clang 0x0000000002607019
2 libpthread.so.0 0x00007ff034c26cb0
3 libc.so.6 0x00007ff033c50425 gsignal + 53
4 libc.so.6 0x00007ff033c53b8b abort + 379
5 libc.so.6 0x00007ff033c490ee
6 libc.so.6 0x00007ff033c49192
7 clang 0x000000000096c0d9
clang::CodeGen::CodeGenFunction::getVLASize(clang::VariableArrayType const*) +
985
8 clang 0x000000000096c25b
clang::CodeGen::CodeGenFunction::getVLASize(clang::QualType) + 43
9 clang 0x0000000000a09733
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&) + 211
10 clang 0x0000000000a0a3b6
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) + 22
11 clang 0x0000000000954267
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 103
12 clang 0x000000000095d6e5
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 277
13 clang 0x0000000000959667
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 39
14 clang 0x000000000095d1d0
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 80
15 clang 0x0000000000966d4a
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 74
16 clang 0x000000000096b37b
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 635
17 clang 0x000000000098d29e
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 654
18 clang 0x000000000098d5e1
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 225
19 clang 0x000000000098eaf7
clang::CodeGen::CodeGenModule::EmitDeferred() + 183
20 clang 0x000000000098eb7d clang::CodeGen::CodeGenModule::Release()
+ 13
21 clang 0x000000000091f62a
22 clang 0x0000000000acf1d4 clang::ParseAST(clang::Sema&, bool, bool)
+ 372
23 clang 0x000000000078e15a clang::FrontendAction::Execute() + 282
24 clang 0x00000000007703f0
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
25 clang 0x0000000000755e4d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1693
26 clang 0x000000000074f110 cc1_main(char const**, char const**, char
const*, void*) + 1232
27 clang 0x0000000000732479 main + 665
28 libc.so.6 0x00007ff033c3b76d __libc_start_main + 237
29 clang 0x000000000074eacd
Stack dump:
0. Program arguments: .../clang -cc1 -triple x86_64-unknown-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name t.cpp -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -coverage-file
/nfs/thonermann/tmp/tmp/t.o -resource-dir
/nfs/thonermann/products/linux-x86/clang-3.4-opt/bin/../lib/clang/3.4
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/nfs/thonermann/products/linux-x86/clang-3.4-opt/bin/../lib/clang/3.4/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /nfs/thonermann/tmp/tmp
-ferror-limit 19 -fmessage-length 197 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o t.o -x c++ t.cpp
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. t.cpp:5:14: Generating code for declaration 'f()::LS::mf'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix</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>