On Apr 26, 2013, at 3:06 PM, Dmitri Gribenko <[email protected]> wrote:

> On Fri, Apr 26, 2013 at 11:55 PM, Fariborz Jahanian <[email protected]> 
> 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.
>> +@interface NSObject
>> +@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.

OK. I will add a c-index test (without removing the existing one which took 
quite time
to get it right :).

> 
> 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.

You are right. There are cases which will not make sense. But, not knowing 
that, we pick the first
one we see (which meets our user requirements). Generally, Important classes 
must have their own 
comments.

- Fariborz

> 
> 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 <[email protected]>*/

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to