[RFE] allow assign to members of rvalue aggregate (-fpermissive) #40016
Open
Description
| Bugzilla Link | 40670 |
| Version | unspecified |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended Description
#include <iostream>
#include <cstdlib>
class s {
public:
int a;
~s() { std::cout << "a=" << a << std::endl; }
};
static s foo()
{
return s{0};
}
int main()
{
foo().a = 5;
int *p = std::malloc(sizeof(int));
return *p;
}This code can be compiled with g++ if -fpermissive is used.
clang++ doesn't compile it with any options.
Activity