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: unassignedclangb...@nondot.org
          Reporter: andrey.kules...@intel.com
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to