[LLVMbugs] [Bug 9885] New: Regression: clang crashes when compiling current libc++ while parsing <locale>'s time_put

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 10 00:50:13 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9885

           Summary: Regression: clang crashes when compiling current
                    libc++ while parsing <locale>'s time_put
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Trying to build the current libc++ results in a clang crash. It crashes while
parsing the <locale> 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.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list