Adds a function to check if a method has been deleted by copy-pasting the existing implementation of clang_CXXMethod_isDefaulted and changing it to call CXXMethod::isDeleted() instead.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/tools/libclang/CIndex.cpp | ||
---|---|---|
8870 |
Thanks for this! Can you add a release note to clang/docs/ReleaseNotes.rst and some test coverage for the change to clang/test/Index for the change? Also, it looks like precommit CI found a relevant failure that needs to be fixed:
******************** TEST 'Clang :: Index/availability.cpp' FAILED ******************** Script: -- : 'RUN: at line 9'; c:\ws\w3\llvm-project\premerge-checks\build\bin\c-index-test.exe -test-print-type --std=c++11 C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp | c:\ws\w3\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp -- Exit Code: 1 Command Output (stdout): -- $ ":" "RUN: at line 9" $ "c:\ws\w3\llvm-project\premerge-checks\build\bin\c-index-test.exe" "-test-print-type" "--std=c++11" "C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp" $ "c:\ws\w3\llvm-project\premerge-checks\build\bin\filecheck.exe" "C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp" # command stderr: C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp:12:11: error: CHECK: expected string not found in input // CHECK: CXXMethod=foo:4:7 (unavailable) [type=int (){{.*}}] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] ^ <stdin>:394:71: note: scanning from here StructDecl=Foo:3:8 (Definition) [type=Foo] [typekind=Record] [isPOD=1] [isAnonRecDecl=0] ^ <stdin>:395:1: note: possible intended match here CXXMethod=foo:4:7 (unavailable) (deleted) [type=int ()] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] [isAnonRecDecl=0] ^ Input file: <stdin> Check file: C:\ws\w3\llvm-project\premerge-checks\clang\test\Index\availability.cpp -dump-input=help explains the following input dump. Input was: <<<<<< . . . 389: macro definition=__STDCPP_DEFAULT_NEW_ALIGNMENT__ [type=] [typekind=Invalid] [isPOD=0] [isAnonRecDecl=0] 390: macro definition=__STDCPP_THREADS__ [type=] [typekind=Invalid] [isPOD=0] [isAnonRecDecl=0] 391: macro definition=__STDC_UTF_16__ [type=] [typekind=Invalid] [isPOD=0] [isAnonRecDecl=0] 392: macro definition=__STDC_UTF_32__ [type=] [typekind=Invalid] [isPOD=0] [isAnonRecDecl=0] 393: FunctionDecl=foo:1:6 (unavailable) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0] [isAnonRecDecl=0] 394: StructDecl=Foo:3:8 (Definition) [type=Foo] [typekind=Record] [isPOD=1] [isAnonRecDecl=0] check:12'0 X~~~~~~~~~~~~~~~~~~ error: no match found 395: CXXMethod=foo:4:7 (unavailable) (deleted) [type=int ()] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] [isAnonRecDecl=0] check:12'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ check:12'1 ? possible intended match 396: CXXConstructor=Foo:5:3 (unavailable) (default constructor) (deleted) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0] [isAnonRecDecl=0] check:12'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>>> error: command failed with exit status: 1 -- ********************
Updating based on review
- Add new function to release notes
- Fix failing test and add a new test specifically for this function
Looks like the new version you uploaded is only the changes to the last version. You need to merge that into your previous commit and upload a patch of that. (e.g. using git rebase -i or even just git commit --amend).
clang/docs/ReleaseNotes.rst | ||
---|---|---|
399 |
OK that should all be good now. Thanks for your patience, it's my first time doing all this.
LGTM aside from the one minor nit.
Do you need someone to commit on your behalf? If so, what name and email address would you like used for patch attribution?
clang/docs/ReleaseNotes.rst | ||
---|---|---|
399 | Looks like this change still needs to be applied. |
Yes it's probably safest if someone commits on my behalf, unless someone's got time to walk me through it. Just use Anders Langlands anderslangands@gmail.com for attribution please.