Skip to content

Regression: clang crashes when compiling constructor call to protected base constructor with argument #10257

@llvmbot

Description

@llvmbot
Bugzilla Link 9885
Resolution DUPLICATE
Resolved on May 10, 2011 09:02
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

Trying to build the current libc++ results in a clang crash. It crashes while parsing the header.

The same happens with the following reduced test case:

class string;
class ios_base;
struct _xlocale;
struct tm;
typedef struct _xlocale * locale_t;
typedef unsigned long size_t;

class __time_put
{
locale_t _loc;
protected:
__time_put(const string& __nm);
};

template <class _CharT, class _OutputIterator>
class attribute ((visibility("default"))) time_put
: private __time_put
{
protected:
// Commenting this constructor removes the crash:
attribute ((visibility("hidden"), always_inline))
explicit time_put(const string& __nm, size_t __refs)
// Commenting the base class constructor call removes the crash:
: __time_put(__nm) {}
};

int main(int, char**)
{
}

This results in:

getSpecialMember on non-special member
UNREACHABLE executed at /Users/rynnsauer/LLVM/llvm/tools/clang/lib/Sema/SemaDecl.cpp:1521!
[...]
Stack dump:
0. Program arguments: /opt/bin/clang -cc1 -triple x86_64-apple-macosx10.6.7 -emit-obj -mrelax-all -disable-free -main-file-name clang.cpp -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 97.17 -resource-dir /opt/bin/../lib/clang/3.0 -nostdinc++ -cxx-isystem /usr/include/c++/v1 -std=c++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 100 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/RI/RI4iqAygH0OWeTzP0+rLU++++TI/-Tmp-/cc-v4anXa.o -x c++ clang.cpp

  1. clang.cpp:24:22: current parser token '{'
  2. clang.cpp:16:1: parsing struct/union/class body 'time_put'

My clang version:

$ /opt/bin/clang --version
clang version 3.0 (trunk 131121)
Target: x86_64-apple-darwin10.7.0
Thread model: posix

This did not happen with clang trunk 131082.

Complete crash log to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions