This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Implement LWG 2015 for the builtin type-traits.
Changes PlannedPublic

Authored by EricWF on Apr 3 2017, 6:35 PM.

Details

Summary

This patch implements LWG 2015, which requires than arrays used with [meta.unary.prop] traits have a complete element type.

Note that this patch should still diagnose the same cases as before, however the diagnostic now points to the base element type of an multi-dimensional array, instead of the array type itself.

If I'm not mistaken the correct thing to do is to retroactively apply it to C++11 even though it first appeared in the C++14 standard.

Diff Detail

Event Timeline

EricWF created this revision.Apr 3 2017, 6:35 PM
EricWF updated this revision to Diff 93985.Apr 3 2017, 6:50 PM
EricWF edited the summary of this revision. (Show Details)
aaron.ballman edited edge metadata.Apr 3 2017, 7:22 PM

If I'm not mistaken the correct thing to do is to retroactively apply it to C++11 even though it first appeared in the C++14 standard.

That is how we typically handle DRs.

Do you also need to change the implementation of EvaluateBinaryTypeTrait() for the changes to is_base_of()?

lib/Sema/SemaExprCXX.cpp
4083–4084

Is this correct for has_virtual_destructor()? LWG 2015 treats that the same as is_empty() and friends.

EricWF planned changes to this revision.Apr 3 2017, 7:46 PM

Woops. This may actually be entirely unneeded.

lib/Sema/SemaExprCXX.cpp
4083–4084

It's not correct. I'll update with a fix later this week.