This is an archive of the discontinued LLVM Phabricator instance.

[CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept
ClosedPublic

Authored by nwilson on Jul 29 2015, 10:39 AM.

Details

Summary

Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized.

Diff Detail

Event Timeline

nwilson updated this revision to Diff 30919.Jul 29 2015, 10:39 AM
nwilson retitled this revision from to Add concept to VarDecl and diagnostic for unitialized variable concept.
nwilson updated this object.
nwilson added a subscriber: cfe-commits.

If deemed necessary, I can split this patch out to two patches; one for adding IsConcept to the NonParmVarDeclBitfields bitfield and associated VarDecl member functions and another patch for the Diagnostic/tests

nwilson retitled this revision from Add concept to VarDecl and diagnostic for unitialized variable concept to [CONCEPTS] Add concept to VarDecl and diagnostic for unitialized variable concept.Jul 29 2015, 10:52 AM
nwilson retitled this revision from [CONCEPTS] Add concept to VarDecl and diagnostic for unitialized variable concept to [CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept.
rsmith accepted this revision.Jul 29 2015, 6:43 PM
rsmith edited edge metadata.

LGTM

Eventually, we'll presumably want separate isConstexprSpecified / isConstexpr functions on VarDecl (and FunctionDecl), and for the concept specifier to imply constexpr, but that can wait for a separate change.

lib/Sema/SemaDecl.cpp
9417–9418

Looks like this would fit on one line.

This revision is now accepted and ready to land.Jul 29 2015, 6:43 PM
nwilson updated this revision to Diff 30986.Jul 29 2015, 9:39 PM
nwilson edited edge metadata.

Putting diagnostic on one line.

nwilson closed this revision.Aug 3 2015, 7:26 AM