LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 17427 - Assertion failed: "Computed __func__ length differs from type!"
Summary: Assertion failed: "Computed __func__ length differs from type!"
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: LLVM Codegen (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-01 07:18 PDT by Jacob Parker
Modified: 2014-10-09 04:07 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments
code, output, etc. (13.13 KB, application/zip)
2013-10-01 07:18 PDT, Jacob Parker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Parker 2013-10-01 07:18:47 PDT
Created attachment 11311 [details]
code, output, etc.

Compile the attached ouch.cc with "clang++ --std=c++1y ouch.cc" (with "clang version 3.4 (trunk 191640)") and the following assertion fails:

clang: /users/j3parker/src/llvm/tools/clang/lib/CodeGen/CGExpr.cpp:1984: clang::CodeGen::LValue clang::CodeGen::CodeGenFunction::EmitPredefinedLValue(const clang::PredefinedExpr *): Assertion `cast<ConstantArrayType (E->getType())->getSize() - 1 == FunctionName.size() && "Computed __func__ length differs from type!"' failed.

However, if you change the name of the type "cat" to "lynx" (the feline, not the browser!) then the assertion will not fail. (See the included ouch2.cpp)
Comment 1 Peeter Joot 2014-01-15 17:34:16 PST
fyi.  This appears to be an issue on the 3.5 trunk too (seen with a different codebase, but the same assert triggering).

Is there an alternate clang assertion macro that can be used here to print the variables being compared along with the assertion message itself?
Comment 2 Peeter Joot 2014-02-24 09:13:53 PST
fyi.  It looks like erik olofsson, points out the specific commit that introduces this issue:

http://llvm-reviews.chandlerc.com/D1491#comment-7