Working on c++2a Designated initializers

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Working on c++2a Designated initializers

Oleg Smolsky via cfe-dev
Hi cfe,

My employer (Cruise Automation) is hosting a hackathon and there have been a few reports of people running into strange errors in a few edge cases when using designated initializers in clang++, (I'm still working on finding a repro case, I'll post it when I find it) which I wanted to fix since we use them all over. Digging in, I discovered that the current version is only an extension and the feature just voted in to c++20 will actually enforce some rather strict rules. 

I wondered if there was a currently outstanding ticket or if anyone had started work on implementing the C++20 version and warnings for non-standard behavior? I checked Phabricator, but didn't see anything obvious. I realize properly adding support is probably a more involved project than just a few days, but I was thinking it might be nice to work on in my down time over the winter to get a better understanding of how clang operates.

Thanks,
Walter

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Working on c++2a Designated initializers

Oleg Smolsky via cfe-dev

 

 

From: cfe-dev <[hidden email]> On Behalf Of Walter Gray via cfe-dev
Sent: Thursday, November 15, 2018 6:33 PM
To: [hidden email]
Subject: [cfe-dev] Working on c++2a Designated initializers

 

Hi cfe,

 

My employer (Cruise Automation) is hosting a hackathon and there have been a few reports of people running into strange errors in a few edge cases when using designated initializers in clang++, (I'm still working on finding a repro case, I'll post it when I find it) which I wanted to fix since we use them all over. Digging in, I discovered that the current version is only an extension and the feature just voted in to c++20 will actually enforce some rather strict rules. 

 

I wondered if there was a currently outstanding ticket or if anyone had started work on implementing the C++20 version and warnings for non-standard behavior? I checked Phabricator, but didn't see anything obvious. I realize properly adding support is probably a more involved project than just a few days, but I was thinking it might be nice to work on in my down time over the winter to get a better understanding of how clang operates.

 

Thanks,

Walter


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Working on c++2a Designated initializers

Oleg Smolsky via cfe-dev
In reply to this post by Oleg Smolsky via cfe-dev
Hi Walter,

Excuse my empty response just a second ago...

> From: cfe-dev <[hidden email]> On Behalf Of Walter Gray via cfe-dev
> Sent: Thursday, November 15, 2018 6:33 PM

[snip]

> I wondered if there was a currently outstanding ticket or if anyone had started work on implementing the C++20 version and warnings for non-standard behavior? I checked Phabricator, but didn't see anything obvious. I realize properly adding support is probably a more involved project than just a few days, but I was thinking it might be nice to work on in my down time over the winter to get a better understanding of how clang operates.
>
> Thanks,
> Walter

While I don't have much details, you can keep track of the c++2a support here:
https://clang.llvm.org/cxx_status.html

-Matt
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Working on c++2a Designated initializers

Oleg Smolsky via cfe-dev
Excellent, thanks!
 
Regarding the error I mentioned, I've managed to track down the repro case our other engineers had reported, and it appears to be another instance of https://bugs.llvm.org/show_bug.cgi?id=31732. I think that bug should probably have it's priority raised though, because I've managed to create variations on it which do not trigger any kind of assertion or warning in normal clang builds, and wind up causing really tricky errors like constructors silently never being called, or lines of code that involve types constructed in this fashion simply being removed. I'll see what I can do about building a fix - The error can't happen in c++20 conformant code, however as long as clang allows this extension, people using it should at least get a warning when they trip this kind of behavior.

On Fri, Nov 16, 2018 at 9:29 AM <[hidden email]> wrote:
Hi Walter,

Excuse my empty response just a second ago...

> From: cfe-dev <[hidden email]> On Behalf Of Walter Gray via cfe-dev
> Sent: Thursday, November 15, 2018 6:33 PM

[snip]

> I wondered if there was a currently outstanding ticket or if anyone had started work on implementing the C++20 version and warnings for non-standard behavior? I checked Phabricator, but didn't see anything obvious. I realize properly adding support is probably a more involved project than just a few days, but I was thinking it might be nice to work on in my down time over the winter to get a better understanding of how clang operates.
>
> Thanks,
> Walter

While I don't have much details, you can keep track of the c++2a support here:
https://clang.llvm.org/cxx_status.html

-Matt

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev