r180629 - document parsing. When a sub-class (c++ Objective-C) missing

Dmitri Gribenko gribozavr at gmail.com
Fri Apr 26 15:06:22 PDT 2013


On Fri, Apr 26, 2013 at 11:55 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> Added: cfe/trunk/test/Misc/ast-dump-subclass-comment.mm
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-subclass-comment.mm?rev=180629&view=auto
> ==============================================================================
> --- cfe/trunk/test/Misc/ast-dump-subclass-comment.mm (added)
> +++ cfe/trunk/test/Misc/ast-dump-subclass-comment.mm Fri Apr 26 15:55:38 2013
> @@ -0,0 +1,101 @@
> +// RUN: %clang_cc1 -x objective-c++ -Wdocumentation -ast-dump %s | FileCheck %s
> +// rdar://13647476
> +
> +//! NSObject is root of all.
> + at interface NSObject
> + at end
> +// CHECK: ObjCInterfaceDecl{{.*}}NSObject
> +// CHECK-NEXT:   FullComment 0x{{[^ ]*}} <line:[[@LINE-4]]:4, col:28>
> +// CHECK-NEXT:     ParagraphComment{{.*}} <col:4, col:28>
> +// CHECK-NEXT:       TextComment{{.*}} <col:4, col:28> Text=" NSObject is root of all."

Hi Fariborz,

Why does this test use -ast-dump?  Usually c-index-test is used to
test if comment is attached to something.  There are fewer CHECK lines
that way.

Also, about the approach this patch implements -- while it makes sense
in some cases, it can be confusing in most other situations.  For
example:

/// A window.
class Window {};
class Door {};

class House : Window, Door {};

'House' will pick up the 'Window' comment, which is probably not what
the user wants.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list