This is an archive of the discontinued LLVM Phabricator instance.

Add a note that points to the linkage specifier for the "must have C++ linkage" errors
ClosedPublic

Authored by arphaman on Nov 1 2016, 7:04 AM.

Details

Summary

This patch improves the "must have C++ linkage" error diagnostics for C++ by adding an additional note that points to the appropriate extern "C" linkage specifier. This patch covers the diagnostics for templates and literal operators, which AFAIK are the only declarations that emit this particular kind of error. Please let me know if you think there are errors for other C++ declarations that require similar changes.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 76544.Nov 1 2016, 7:04 AM
arphaman retitled this revision from to Add a note that points to the linkage specifier for the "must have C++ linkage" errors.
arphaman updated this object.
arphaman added reviewers: rsmith, rjmccall.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: cfe-commits.
erik.pilkington added inline comments.
lib/Sema/SemaTemplate.cpp
5946 ↗(On Diff #76544)

Can you update the name of this diagnostic to not mention modules, now that we use it more generally?

arphaman updated this revision to Diff 76577.Nov 1 2016, 9:25 AM
arphaman marked an inline comment as done.

The updated patch renames the note diagnostic to a more generic rename.

rjmccall accepted this revision.Nov 1 2016, 4:35 PM
rjmccall edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 1 2016, 4:35 PM
This revision was automatically updated to reflect the committed changes.