[llvm-bugs] [Bug 43266] New: Clang parser bug

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 10 10:09:17 PDT 2019


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

            Bug ID: 43266
           Summary: Clang parser bug
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: daniel.cooke at me.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Following fails to compile for Clang 8.0.0+

template<class L> struct mp_size;

struct __mpf_struct
{
    int _mp_size;
};

struct X
{
    __mpf_struct m_data[1];

    void f()
    {
        if(((m_data)->_mp_size < 0 ? -1: (m_data)->_mp_size > 0) == 0)
        {
        }
    }
};

$ clang++ -std=c++14 bug.cpp -o bug
bug.cpp:14:23: error: no template named '_mp_size'; did you mean 'mp_size'?
        if(((m_data)->_mp_size < 0 ? -1: (m_data)->_mp_size > 0) == 0)
                      ^~~~~~~~
                      mp_size
bug.cpp:1:26: note: 'mp_size' declared here
template<class L> struct mp_size;
                         ^
bug.cpp:14:23: error: no member named '_mp_size' in '__mpf_struct'
        if(((m_data)->_mp_size < 0 ? -1: (m_data)->_mp_size > 0) == 0)
            ~~~~~~~~  ^
2 errors generated.
Dans-MacBook-Pro:scratch dcooke$ clang++ -std=c++14 bug.cpp -o bug
bug.cpp:14:23: error: no template named '_mp_size'; did you mean 'mp_size'?
        if(((m_data)->_mp_size < 0 ? -1: (m_data)->_mp_size > 0) == 0)
                      ^~~~~~~~
                      mp_size
bug.cpp:1:26: note: 'mp_size' declared here
template<class L> struct mp_size;
                         ^
bug.cpp:14:23: error: no member named '_mp_size' in '__mpf_struct'
        if(((m_data)->_mp_size < 0 ? -1: (m_data)->_mp_size > 0) == 0)
            ~~~~~~~~  ^
2 errors generated.

-- 
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/20190910/d606d616/attachment-0001.html>


More information about the llvm-bugs mailing list