25 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation-unknown-command -verify %s2// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Werror -Wno-documentation-unknown-command %s3 4// expected-warning@+1 {{unknown command tag name}}5/// aaa \unknown6int test_unknown_comand_1;7 8// expected-warning@+1 {{unknown command tag name 'retur'; did you mean 'return'?}}9/// \retur aaa10int test_unknown_comand_2();11 12/// We don't recognize commands in double quotes: "\n\t @unknown2".13int test_unknown_comand_3();14 15// expected-warning@+2 {{unknown command tag name}}16// expected-warning@+2 {{unknown command tag name}}17/// But it has to be a single line: "\unknown318/// @unknown4" (Doxygen treats multi-line quotes inconsistently.)19int test_unknown_comand_4();20 21// RUN: c-index-test -test-load-source all -Wdocumentation-unknown-command %s > /dev/null 2> %t.err22// RUN: FileCheck < %t.err -check-prefix=CHECK-RANGE %s23// CHECK-RANGE: warn-documentation-unknown-command.cpp:5:9:{5:9-5:17}: warning: unknown command tag name24// CHECK-RANGE: warn-documentation-unknown-command.cpp:9:5:{9:5-9:11}: warning: unknown command tag name 'retur'; did you mean 'return'?25