Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Invalid error with declspec(property..) and templates #50822

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51855
Status NEW
Importance P normal
Reported by Jeroen Dobbelaere (jeroen.dobbelaere@synopsys.com)
Reported on 2021-09-14 09:25:31 -0700
Last modified on 2021-10-12 06:47:55 -0700
Version 12.0
Hardware PC Windows NT
CC a.bataev@hotmail.com, blitzrakete@gmail.com, david.majnemer@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments file_51855.txt (652 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 25254
test01.cpp

The mere addition of an unrelated
   F operator*=(F& lhs, int rhs) { return lhs; }

results in a compilation error related to __declspec(property) and templates:

<source>:32:17: error: invalid operands to binary expression ('<pseudo-object
type>' and 'int')
    tmp.theData *= 2;
    ~~~~~~~~~~~ ^  ~
<source>:38:11: note: in instantiation of function template specialization
'fum<S>' requested here
   return fum<S>();
          ^

See https://www.godbolt.org/z/KErjj7qET  for a reproduction.

(or compile the attached file with '-O3 -fms-extensions'
Quuxplusone commented 3 years ago

Attached file_51855.txt (652 bytes, text/plain): test01.cpp

Quuxplusone commented 3 years ago

Added few person that seem to have be working on MSProperty related code in clang/lib/Sema/SemaExpr.cpp to the CC list.

Quuxplusone commented 3 years ago

Proposed fix: https://reviews.llvm.org/D111639