[LLVMbugs] [Bug 16388] New: Segfault when using -g on code with struct inheriting std::chrono::duration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 20 06:12:26 PDT 2013


            Bug ID: 16388
           Summary: Segfault when using -g on code with struct inheriting
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: 1zeeky at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10712
  --> http://llvm.org/bugs/attachment.cgi?id=10712&action=edit

I'm getting a Segfault when compiling code that instantiates a
std::chrono::time_point<clock> with clock::duration being a struct inheriting
from std::chrono::duration.

When I typedef clock::duration to std::chrono::duration, it compiles fine.
When not using -g, it compiles fine.

Additionally, not sure if this is related, some error in the code or a
different bug:
I typedef'd the std::chrono::time_point<clock>, but when not using the typedef
(so instead write out the type) I get a compiler error about clock not being a

Note that instancing clock::duration does not result in any error.

The attached testcase crashes when compiling with -g (fine without -g).
You can define the NO_CRASH macro to use a typedef to std::chrono::duration
instead of a struct inheriting the type, which compiles fine.
You can also define the C_ERR macro to use std::chrono::time_point<clock>
instead of the typedef, which results in a compiler error.

I used the C++ standard-library from gcc 4.8.1 for this.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130620/46323a48/attachment.html>

More information about the llvm-bugs mailing list