summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/TemplateBase.cpp
diff options
context:
space:
mode:
authorJames Dennett <jdennett@google.com>2015-07-15 19:13:39 +0000
committerJames Dennett <jdennett@google.com>2015-07-15 19:13:39 +0000
commit2def1e8ad6b84d1a8a18de8789093e5faf8d3aed (patch)
tree087ef355de6abb8a6ca782b5c5911f7506d1141b /clang/lib/AST/TemplateBase.cpp
parent525579d41cb7ecdc72418326585adacf88bb5bc2 (diff)
downloadbcm5719-llvm-2def1e8ad6b84d1a8a18de8789093e5faf8d3aed.tar.gz
bcm5719-llvm-2def1e8ad6b84d1a8a18de8789093e5faf8d3aed.zip
Allow any comment to be a trailing comment when -fparse-all-comments is on.
This helps with freeform documentation styles, where otherwise code like enum class E { E1, // D1 E2 // D2 }; would result in D1 being associated with E2. To properly associate E1 with D1 and E2 with D2, this patch allows all raw comments C such that C.isParseAllComments() to participate in trailing comment checks inside getRawCommentForDeclNoCache. This takes care of linking the intended documentation with the intended decls. There remains an issue with code like: foo(); // DN int x; To prevent DN from being associated with x, this patch adds a new test on preceding-line comments C (where C.isParseAllComments() and also C's kind is RCK_OrdinaryBCPL or RCK_OrdinaryC) that checks whether C is the first non-whitespace thing on C's starting line. Patch from Luke Zarko <zarko@google.com>, D11069 reviewed by rsmith. llvm-svn: 242317
Diffstat (limited to 'clang/lib/AST/TemplateBase.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud