[cling] Add deprecation warning for declarations without `auto`
Declarations without the auto keyword are not part of standard C++. Even though it is a nice feature to have, it requires a patch on top of clang and is one of the hurdles preventing us from using the upstream clang.
Implicit auto injection is currently only supported at the prompt (and only in the top-most function-level scope). So it should ideally not break other features.
There are a few GitHub and JIRA issues related to this feature that can also be closed if we completely remove it.
For the warning messages, I'm reusing one of the existing clang warning message (to not introduce more patches on top of the clang with custom error messages).
EDIT: Glancing through JIRA issues, these are the issues that can be closed (list might not be exhaustive):
https://its.cern.ch/jira/browse/ROOT-10309 https://its.cern.ch/jira/browse/ROOT-10593 https://its.cern.ch/jira/browse/ROOT-10284 https://its.cern.ch/jira/browse/ROOT-8828 https://its.cern.ch/jira/browse/ROOT-8538 https://its.cern.ch/jira/browse/ROOT-7970
This Pull request:
Requires https://github.com/root-project/roottest/pull/1056 to be merged for tests to pass
Changes or fixes:
Checklist:
- [ ] tested changes locally
- [ ] updated the docs (if necessary)
This PR fixes #
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
New warning message (for reference):
Test Results
12 files 12 suites 2d 2h 47m 24s :stopwatch: 2 586 tests 2 586 :white_check_mark: 0 :zzz: 0 :x: 29 057 runs 29 057 :white_check_mark: 0 :zzz: 0 :x:
Results for commit c36e2fd6.
:recycle: This comment has been updated with latest results.
Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
- projectroot.roottest.root.collection.roottest_root_collection_execTClonesArrayAbsorb_auto
- projectroot.roottest.root.hist.profile.roottest_root_hist_profile_runcopy
- projectroot.roottest.root.io.TFile.roottest_root_io_TFile_make
- projectroot.roottest.root.io.directory.roottest_root_io_directory_make
- projectroot.roottest.root.meta.ROOT-7181.roottest_root_meta_ROOT_7181_make
- projectroot.roottest.root.tree.cache.roottest_root_tree_cache_cachedChain
- projectroot.roottest.root.tree.entrylist.roottest_root_tree_entrylist_make
- projectroot.roottest.root.tree.selector.roottest_root_tree_selector_make
- projectroot.roottest.root.treeformula.schemaEvolution.roottest_root_treeformula_schemaEvolution_make
- projectroot.roottest.root.treeformula.string.roottest_root_treeformula_string_make
Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.
Failing tests:
- projectroot.roottest.root.collection.roottest_root_collection_execTClonesArrayAbsorb_auto
- projectroot.roottest.root.treeproxy.roottest_root_treeproxy_make
- projectroot.roottest.root.hist.profile.roottest_root_hist_profile_runcopy
- projectroot.roottest.root.io.TFile.roottest_root_io_TFile_make
- projectroot.roottest.root.io.directory.roottest_root_io_directory_make
- projectroot.roottest.root.meta.ROOT-7181.roottest_root_meta_ROOT_7181_make
- projectroot.roottest.root.tree.addresses.roottest_root_tree_addresses_make
- projectroot.roottest.root.tree.branches.roottest_root_tree_branches_make
- projectroot.roottest.root.tree.cache.roottest_root_tree_cache_cachedChain
- projectroot.roottest.root.tree.entrylist.roottest_root_tree_entrylist_make
And 6 more
Build failed on mac12arm/cxx20. Running on 194.12.161.128:/Users/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
- projectroot.roottest.root.treeproxy.roottest_root_treeproxy_make
- projectroot.roottest.root.tree.addresses.roottest_root_tree_addresses_make
- projectroot.roottest.root.tree.branches.roottest_root_tree_branches_make
- projectroot.roottest.root.tree.friend.roottest_root_tree_friend_make
- projectroot.roottest.root.treeformula.array.roottest_root_treeformula_array_make
- projectroot.roottest.root.treeformula.parse.roottest_root_treeformula_parse_make
- projectroot.roottest.root.collection.roottest_root_collection_execTClonesArrayAbsorb_auto
- projectroot.roottest.root.hist.profile.roottest_root_hist_profile_runcopy
- projectroot.roottest.root.io.TFile.roottest_root_io_TFile_make
- projectroot.roottest.root.io.directory.roottest_root_io_directory_make
And 6 more
There are a few GitHub and JIRA issues related to this feature that can also be closed if we completely remove it.
Please list those here. Thanks.
For the warning messages, I'm reusing one of the existing clang warning message (to not introduce more patches on top of the clang with custom error messages).
Can you be more explicit of what it looks like? (I.e. clarifying whether this result is an ambiguous message or not).
New warning message (for reference):
@pcanal: This is how the warning message looks like. The warning (-Wdeprecated-declarations) I think make sense for deprecating this feature.
Added JIRA issues in the PR description. Couldn't find any open GitHub issues.
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
In principle LGTM; is it possible to test this in our infrastructure, to make sure the warning pops up where we expect it and that the "feature" continues to work for the time being? After removing the instances from
roottest, we would otherwise lack coverage...
Is this test sufficient?
https://github.com/devajithvs/root/blob/master/core/metacling/test/TClingTests.cxx#L91
Or should the test go in roottest repository.?
Maybe add the most common pattern that gets removed from roottest: /* no auto */ t = new TTree("tree","tree"); Ideally it would be nice if we check that the warning is correctly triggered...
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.
Errors:
- [2024-02-20T12:20:57.605Z] LINK : fatal error LNK1104: cannot open file 'C:\build\workspace\root-pullrequests-build\build\bin\libCore.dll' [C:\build\workspace\root-pullrequests-build\build\core\Core.vcxproj]
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.
Errors:
- [2024-02-20T12:28:27.695Z] LINK : fatal error LNK1104: cannot open file 'C:\build\workspace\root-pullrequests-build\build\bin\libCore.dll' [C:\build\workspace\root-pullrequests-build\build\core\Core.vcxproj]
Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
- projectroot.roottest.root.meta.ROOT-7181.roottest_root_meta_ROOT_7181_make
- projectroot.tmva.pymva.test.PyMVA_Torch_Classification
- projectroot.tmva.pymva.test.PyMVA_Torch_Regression
- projectroot.tmva.pymva.test.PyMVA_Torch_Multiclass
- projectroot.tmva.pymva.test.gtest_tmva_pymva_test_TestRModelParserPyTorch
Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.
Failing tests:
Build failed on mac12arm/cxx20. Running on 194.12.161.128:/Users/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.
Failing tests:
Build failed on ROOT-performance-centos8-multicore/soversion. Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build See console output.
Failing tests:
Windows is not happy with the new test. I'm not sure how windows handles errors/warnings.
Here's how the warning message looks now:
Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default
How to customize builds
Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
Failing tests:
Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.
