llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.77k stars 11.9k forks source link

Assertion failed: (Result.isInvalid() && "C++ subscript operator overloading is missing candidates!"), function CreateOverloadedArraySubscriptExpr, file SemaOverload.cpp, line 5045. #5732

Closed llvmbot closed 14 years ago

llvmbot commented 15 years ago
Bugzilla Link 5360
Resolution FIXED
Resolved on Feb 22, 2010 12:54
Version unspecified
OS FreeBSD
Attachments test case
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

the attached fails with:

witten /tmp# clang -fsyntax-only jsapi.cpp

Assertion failed: (Result.isInvalid() && "C++ subscript operator overloading is missing candidates!"), function CreateOverloadedArraySubscriptExpr, file SemaOverload.cpp, line 5045. Stack dump:

  1. Program arguments: /usr/local/bin/../libexec/clang-cc -triple i386-unknown-freebsd9.0 -S -disable-free -main-file-name jsapi.cpp --relocation-model static --disable-fp-elim --unwind-tables=0 --mcpu=pentium4 --fmath-errno=1 -fexceptions -fdiagnostics-show-option -o /tmp/cc-9mhTHr.s -x c++ jsapi.cpp
  2. ./nanojit/RegAlloc.h:69:32: current parser token ']'
  3. ./nanojit/RegAlloc.h:44:1: parsing namespace 'nanojit'
  4. ./nanojit/RegAlloc.h:51:2: parsing struct/union/class body 'nanojit::RegAlloc'
  5. ./nanojit/RegAlloc.h:67:45: parsing function body 'nanojit::RegAlloc::getPriority'
  6. ./nanojit/RegAlloc.h:67:45: in compound statement ('{}')
llvmbot commented 14 years ago

We didn't add any built-in candidates for the array subscript, because only pointers trigger that. Now arrays are decayed to pointers for this purpose.

Fixed in r86140.

llvmbot commented 14 years ago

small test case

lattner commented 14 years ago

At this point, we need very small reduced testcases to drive C++ forward. If we can't do that, I recommend closing this as invalid.

llvmbot commented 14 years ago

That's a massive test case. Do you think you could reduce it?