[llvm-bugs] [Bug 27095] New: [ms] restrict qualifier on destructors and constructor definitions are not allowed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 28 02:23:48 PDT 2016


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

            Bug ID: 27095
           Summary: [ms] restrict qualifier on destructors and constructor
                    definitions are not allowed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrey.kuleshov at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

!- __restrict keyword is applied to the destructors and out-of-class
constructors is not allowed bu clang.
MSVC can compile both on a constructor/destuctor and gcc can compile 'restrict'
qualifier on a constructor. This can affect compatibility of Clang.
It seems that qualifier can be ignored with a warning -!

=======Environment=============
OS: Win
Language: C++
Version: trunk (3.9)

========How to reproduce=======
struct D { ~D() __restrict; };
 D::~D() {}

class C{ C(); };
C::C() __restrict{;}

=============Error===============
>>>clang:
test.cpp(1,12) :  error: 'restrict' qualifier is not allowed on a destructor
struct D { ~D() __restrict; };
test.cpp(2,5) :  error: definition of implicitly declared destructor
 D::~D() {}
test.cpp(5,4) :  error: 'restrict' qualifier is not allowed on a constructor
C::C() __restrict{;}

>>>gcc:
<NO ERROR ON CONSTRUCTOR>
test.cpp:1:17: error: destructors may not be cv-qualified
 struct D { ~D() __restrict; };
                 ^
>>>MSVC: no diagnostics


Andrey Kuleshov
======
Software Engineer
Intel Compiler Team

-- 
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/20160328/0f8b6cf1/attachment.html>


More information about the llvm-bugs mailing list