This is an archive of the discontinued LLVM Phabricator instance.

C does not have inline variables
ClosedPublic

Authored by probinson on Jul 7 2016, 2:33 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

probinson updated this revision to Diff 63137.Jul 7 2016, 2:33 PM
probinson retitled this revision from to C does not have inline variables.
probinson updated this object.
probinson added a reviewer: rsmith.
probinson added a subscriber: cfe-commits.
aaron.ballman accepted this revision.Jul 14 2016, 10:08 AM
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a subscriber: aaron.ballman.

LGTM! I don't think we intended this to be an extension for C.

This revision is now accepted and ready to land.Jul 14 2016, 10:08 AM
majnemer added inline comments.
lib/Sema/SemaDecl.cpp
6189–6191 ↗(On Diff #63137)

I'd suggest sorting this condition higher. It doesn't make much sense to mention block scopes when inline variables are prohibited in all contexts in C.

probinson marked an inline comment as done.Jul 14 2016, 3:18 PM
probinson added inline comments.
lib/Sema/SemaDecl.cpp
6189–6191 ↗(On Diff #63137)

Right... for some reason the word 'block' in the comment made me think it was an Objective-C thing. The C-language check is first now.

probinson updated this revision to Diff 64053.Jul 14 2016, 3:20 PM
probinson edited edge metadata.
probinson marked an inline comment as done.

Reorder the checks. I didn't see any tests for the adjacent (C++) diagnostics so I added some.

rsmith accepted this revision.Jul 14 2016, 3:24 PM
rsmith edited edge metadata.

Thanks!

This revision was automatically updated to reflect the committed changes.