Page MenuHomePhabricator

[Sema] Store deduced type in TypeLoc
Changes PlannedPublic

Authored by ilya-biryukov on Thu, Jan 9, 3:44 AM.

Details

Reviewers
None
Summary

This greatly simplifies source-level tools that need to know what 'auto'
deduced to, e.g. clangd.

Also change default presentation of such types to print 'auto' instead
of the deduced type. To print the deduced types, one shoould set the
PrintingPolicy::Flag to true.

Diff Detail

Unit TestsFailed

TimeTest
40 msClang-Unit.Rename/_/ClangRenameTests::RenameClassTests/RenameClassTest.RenameClasses/34
Note: Google Test filter = RenameClassTests/RenameClassTest.RenameClasses/34 [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
40 msClang-Unit.Rename/_/ClangRenameTests::RenameEnumTests/RenameEnumTest.RenameEnums/7
Note: Google Test filter = RenameEnumTests/RenameEnumTest.RenameEnums/7 [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
20 msClang.CXX/dcl_dcl/dcl_spec/dcl_type/dcl_type_class_deduct::p1.cpp
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/lib/clang/10.0.0/include -nostdsysteminc -std=c++1z -verify /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp
160 msClang.SemaCXX::cxx1z-class-template-argument-deduction.cpp
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/lib/clang/10.0.0/include -nostdsysteminc -std=c++1z -verify /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp -DERRORS -Wundefined-func-template
60 msClangd Unit Tests._/ClangdTests::Hover.NoHover
Note: Google Test filter = Hover.NoHover [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
View Full Test Results (9 Failed)

Event Timeline

ilya-biryukov created this revision.Thu, Jan 9, 3:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Jan 9, 3:44 AM
ilya-biryukov planned changes to this revision.EditedThu, Jan 9, 3:46 AM

This produces the following test failures after running check-clang:

Failing Tests (4):                                                                                                                                                                                                 
    Clang :: CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp                                                                                                                                            
    Clang :: SemaCXX/cxx1z-class-template-argument-deduction.cpp                                                                                                                                                   
    Clang-Unit :: Rename/./ClangRenameTests/RenameClassTests/RenameClassTest.RenameClasses/34                                                                                                                      
    Clang-Unit :: Rename/./ClangRenameTests/RenameEnumTests/RenameEnumTest.RenameEnums/7

All 4 are source-location and declaration-printing-related. Could probably be fixed.
Putting the change here, so that it does not get lost, but I've spent my time budget on this (at least for now).

Unit tests: fail. 61166 tests passed, 9 failed and 729 were skipped.

failed: Clang.CXX/dcl_dcl/dcl_spec/dcl_type/dcl_type_class_deduct/p1.cpp
failed: Clang.SemaCXX/cxx1z-class-template-argument-deduction.cpp
failed: Clang-Unit.Rename/_/ClangRenameTests/RenameClassTests/RenameClassTest.RenameClasses/34
failed: Clang-Unit.Rename/_/ClangRenameTests/RenameEnumTests/RenameEnumTest.RenameEnums/7
failed: Clangd Unit Tests._/ClangdTests/Hover.NoHover
failed: Clangd Unit Tests._/ClangdTests/SymbolInfoTests.All
failed: Clangd Unit Tests._/ClangdTests/TargetDeclTest.Lambda
failed: Clangd Unit Tests._/ClangdTests/TargetDeclTest.Types
failed: Extra Tools Unit Tests.clang-include-fixer/find-all-symbols/_/FindAllSymbolsTests/FindAllSymbolsTest.EnumTest

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

nridge added a subscriber: nridge.Thu, Jan 9, 1:19 PM