Bug 202665 - clang++ core dump during compile with invalid syntax
Summary: clang++ core dump during compile with invalid syntax
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-26 06:17 UTC by ajcb
Modified: 2018-02-27 19:03 UTC (History)
2 users (show)

See Also:


Attachments
attachments requested by error message (165.32 KB, application/x-compressed)
2015-08-26 06:17 UTC, ajcb
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ajcb 2015-08-26 06:17:53 UTC
Created attachment 160365 [details]
attachments requested by error message

clang++ dumps core on attached code, which is likely not legitimate C++, as I was experimenting with syntax.

compiled with:
clang++ -o M.exe Multidim.cpp -L/usr/local/lib -std=c++0x

In the source, removal of parenthesis around (&group), in AddGroup parameter list, and (&s), in array declaration in main makes problem go away.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-29 18:11:30 UTC
A commit references this bug:

Author: dim
Date: Mon Jan 29 18:11:27 UTC 2018
New revision: 328555
URL: https://svnweb.freebsd.org/changeset/base/328555

Log:
  Pull in r217197 from upstream clang trunk (by Richard Smith):

    PR20844: If we fail to list-initialize a reference, map to the
    referenced type before retrying the initialization to produce
    diagnostics. Otherwise, we may fail to produce any diagnostics, and
    silently produce invalid AST in a -Asserts build. Also add a note to
    this codepath to make it more clear why we were trying to create a
    temporary.

  This should fix assertions when parsing some forms of incomplete list
  intializers.

  Direct commit to stable/9 and stable/10, since stable/11 and head
  already have this upstream fix.

  Reported by:	ajcbowhill@gmail.com
  PR:		202665

Changes:
  stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
  stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
  stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-02-27 19:03:34 UTC
A commit references this bug:

Author: dim
Date: Tue Feb 27 19:02:50 UTC 2018
New revision: 330080
URL: https://svnweb.freebsd.org/changeset/base/330080

Log:
  Avoid using the C++11 auto keyword, which was introduced in r328555, as
  part of an upstream change.  This is not supported by gcc 4.2.1, which
  is still the default system compiler for some architectures.

  Direct commit to stable/9 and stable/10, since this does not apply to
  stable/11 and head.

  Reported by:	jau@iki.fi
  PR:		202665,226068

Changes:
  stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp