[clang] Serialization: support hashing null template arguments (#141890)
This commit is contained in:
parent
3788d45947
commit
61314076f7
@ -821,6 +821,7 @@ Miscellaneous Clang Crashes Fixed
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed crash when ``-print-stats`` is enabled in compiling IR files. (#GH131608)
|
||||
- Fix code completion crash involving PCH serialzied templates. (#GH139019)
|
||||
|
||||
OpenACC Specific Changes
|
||||
------------------------
|
||||
|
@ -65,7 +65,9 @@ void TemplateArgumentHasher::AddTemplateArgument(TemplateArgument TA) {
|
||||
|
||||
switch (Kind) {
|
||||
case TemplateArgument::Null:
|
||||
llvm_unreachable("Expected valid TemplateArgument");
|
||||
// These can occur in incomplete substitutions performed with code
|
||||
// completion (see PartialOverloading).
|
||||
break;
|
||||
case TemplateArgument::Type:
|
||||
AddQualType(TA.getAsType());
|
||||
break;
|
||||
|
26
clang/test/CodeCompletion/GH139019.cpp
Normal file
26
clang/test/CodeCompletion/GH139019.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: mkdir %t
|
||||
// RUN: split-file %s %t
|
||||
//
|
||||
// RUN: %clang_cc1 -std=c++20 %t/test.hpp -emit-pch -o %t/1.pch
|
||||
// RUN: %clang_cc1 -std=c++20 %t/test.cpp -include-pch %t/1.pch -code-completion-at=%t/test.cpp:7:17
|
||||
|
||||
//--- test.hpp
|
||||
#pragma once
|
||||
class provider_t
|
||||
{
|
||||
public:
|
||||
template<class T>
|
||||
void emit(T *data)
|
||||
{}
|
||||
};
|
||||
|
||||
//--- test.cpp
|
||||
#include "test.hpp"
|
||||
|
||||
void test()
|
||||
{
|
||||
provider_t *focus;
|
||||
void *data;
|
||||
focus->emit(&data);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user