[PATCH] Fix for bug 17427 - Assertion failed: "Computed __func__ length differs from type!"

Alexey Bataev a.bataev at hotmail.com
Tue Sep 16 02:52:37 PDT 2014


Hi rsmith, hfinkel,

There is a problem in PredefinedExpr with the handling of new C++14 feature - return type deduction for normal functions. When function/method is declared as returning an "auto", PredefinedExprs like __PRETTY_FUNCTION__ etc . are built like function returns an "auto" type. But in CodeGen all AutoTypes are arleady deduced to the real types and PredefinedExpr::ComputeName builds the resulting string for function as it returns some deduced real type instead of "auto". The length of this new string is not the same in general as the one produced during semantic phase ("auto" and real type name may have different lengths) and it leads to assertion triggering.

http://reviews.llvm.org/D5365

Files:
  include/clang/AST/PrettyPrinter.h
  lib/AST/Expr.cpp
  lib/AST/TypePrinter.cpp
  test/CodeGenCXX/predefined-expr-cxx14.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5365.13740.patch
Type: text/x-patch
Size: 20718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140916/5c6eec99/attachment.bin>


More information about the cfe-commits mailing list