[llvm-bugs] [Bug 40246] New: clang++ segfault in EmitReturnBlock

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 7 09:44:29 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40246

            Bug ID: 40246
           Summary: clang++ segfault in EmitReturnBlock
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shik.chen at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 21301
  --> https://bugs.llvm.org/attachment.cgi?id=21301&action=edit
code

``` cpp
#include <cstdio>

template<int* p>
void bar() {
    printf("p = %p, *p = %d\n", p, *p);
}

template<class T>
void foo(T) {
    static int x = 456;
    bar<&x>();
}

int main() {
    foo(123);
    return 0;
}
```

`clang++ -std=c++17 segfault.cpp` crashed.

https://godbolt.org/z/Aebp_E

-- 
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/20190107/39a0da94/attachment-0001.html>


More information about the llvm-bugs mailing list