[PATCH] D41566: [Modules TS] Diagnose exported internal linkage declarations

Hamza Sood via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 24 10:45:24 PST 2017


hamzasood created this revision.
hamzasood added reviewers: rsmith, bruno, boris.

Diagnose attempts to export declarations with internal linkage, as mentioned in `[dcl.module.interface]p2` in the Modules TS.

I would've liked to add a FixIt hint to remove the static keyword if present, but I couldn't work out how to get the `SourceRange` that covers it (it's accessible from the `Declarator`, but seemingly not after the actual node has been created).
I've left a fixme comment in there in case anyone else can figure it out.


https://reviews.llvm.org/D41566

Files:
  include/clang/AST/DeclBase.h
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/AST/DeclBase.cpp
  lib/Sema/SemaDecl.cpp
  test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp
  test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm
  test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp
  test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p2.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41566.128112.patch
Type: text/x-patch
Size: 11130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171224/109ccd23/attachment-0001.bin>


More information about the cfe-commits mailing list