Skip to content

Commit 656f5ee

Browse files
authored
Merge branch 'main' into vscode-doc-fix
2 parents 4df7161 + 4c2b1d4 commit 656f5ee

File tree

160 files changed

+4023
-1485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+4023
-1485
lines changed

clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ static FixItHint generateFixItHint(const ObjCPropertyDecl *Decl,
3939
auto NewName = Decl->getName().str();
4040
size_t Index = 0;
4141
if (Style == CategoryProperty) {
42-
Index = Name.find_first_of('_') + 1;
43-
NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
42+
size_t UnderScorePos = Name.find_first_of('_');
43+
if (UnderScorePos != llvm::StringRef::npos) {
44+
Index = UnderScorePos + 1;
45+
NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
46+
}
4447
}
4548
if (Index < Name.size()) {
4649
NewName[Index] = tolower(NewName[Index]);

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ Improvements to Clang's diagnostics
357357
properly being rejected when used at compile-time. It was not implemented
358358
and caused assertion failures before (#GH158471).
359359

360+
- Closed a loophole in the diagnosis of function pointer conversions changing
361+
extended function type information in C mode (#GH41465). Function conversions
362+
that were previously incorrectly accepted in case of other irrelevant
363+
conditions are now consistently diagnosed, identical to C++ mode.
364+
360365
Improvements to Clang's time-trace
361366
----------------------------------
362367

@@ -455,6 +460,7 @@ Bug Fixes to C++ Support
455460
- Fix a crash when attempting to deduce a deduction guide from a non deducible template template parameter. (#130604)
456461
- Fix for clang incorrectly rejecting the default construction of a union with
457462
nontrivial member when another member has an initializer. (#GH81774)
463+
- Diagnose unresolved overload sets in non-dependent compound requirements. (#GH51246) (#GH97753)
458464

459465
Bug Fixes to AST Handling
460466
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/HLSLResource.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ struct ResourceBindingAttrs {
7474
assert(hasBinding() && !isExplicit() && !hasImplicitOrderID());
7575
RegBinding->setImplicitBindingOrderID(Value);
7676
}
77+
void setCounterImplicitOrderID(unsigned Value) const {
78+
assert(hasBinding() && !hasCounterImplicitOrderID());
79+
RegBinding->setImplicitCounterBindingOrderID(Value);
80+
}
81+
82+
bool hasCounterImplicitOrderID() const {
83+
return RegBinding && RegBinding->hasImplicitCounterBindingOrderID();
84+
}
85+
86+
unsigned getCounterImplicitOrderID() const {
87+
assert(hasCounterImplicitOrderID());
88+
return RegBinding->getImplicitCounterBindingOrderID();
89+
}
7790
};
7891

7992
} // namespace hlsl

clang/include/clang/ASTMatchers/GtestMatchers.h

Lines changed: 0 additions & 87 deletions
This file was deleted.

clang/include/clang/Basic/Attr.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4944,6 +4944,7 @@ def HLSLResourceBinding: InheritableAttr {
49444944
std::optional<unsigned> SlotNumber;
49454945
unsigned SpaceNumber;
49464946
std::optional<unsigned> ImplicitBindingOrderID;
4947+
std::optional<unsigned> ImplicitCounterBindingOrderID;
49474948

49484949
public:
49494950
void setBinding(RegisterType RT, std::optional<unsigned> SlotNum, unsigned SpaceNum) {
@@ -4976,6 +4977,17 @@ def HLSLResourceBinding: InheritableAttr {
49764977
assert(hasImplicitBindingOrderID() && "attribute does not have implicit binding order id");
49774978
return ImplicitBindingOrderID.value();
49784979
}
4980+
void setImplicitCounterBindingOrderID(uint32_t Value) {
4981+
assert(!hasImplicitCounterBindingOrderID() && "attribute already has implicit counter binding order id");
4982+
ImplicitCounterBindingOrderID = Value;
4983+
}
4984+
bool hasImplicitCounterBindingOrderID() const {
4985+
return ImplicitCounterBindingOrderID.has_value();
4986+
}
4987+
uint32_t getImplicitCounterBindingOrderID() const {
4988+
assert(hasImplicitCounterBindingOrderID() && "attribute does not have implicit counter binding order id");
4989+
return ImplicitCounterBindingOrderID.value();
4990+
}
49794991
}];
49804992
}
49814993

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4945,6 +4945,12 @@ def HLSLResourceHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
49454945
let Prototype = "void(...)";
49464946
}
49474947

4948+
def HLSLResourceCounterHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
4949+
let Spellings = ["__builtin_hlsl_resource_counterhandlefromimplicitbinding"];
4950+
let Attributes = [NoThrow, CustomTypeChecking];
4951+
let Prototype = "void(...)";
4952+
}
4953+
49484954
def HLSLResourceNonUniformIndex : LangBuiltin<"HLSL_LANG"> {
49494955
let Spellings = ["__builtin_hlsl_resource_nonuniformindex"];
49504956
let Attributes = [NoThrow];

clang/include/clang/Sema/Sema.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10208,15 +10208,12 @@ class Sema final : public SemaBase {
1020810208
bool CStyle, bool &ObjCLifetimeConversion);
1020910209

1021010210
/// Determine whether the conversion from FromType to ToType is a valid
10211-
/// conversion that strips "noexcept" or "noreturn" or "cfi_unchecked_callee"
10212-
/// off the nested function type. This also checks if "cfi_unchecked_callee"
10213-
/// was added to the function type. If "cfi_unchecked_callee" is added and
10214-
/// `AddingCFIUncheckedCallee` is provided, it will be set to true. The same
10215-
/// thing applies for `DiscardingCFIUncheckedCallee` if the attribute is
10216-
/// discarded.
10217-
bool IsFunctionConversion(QualType FromType, QualType ToType,
10218-
bool *DiscardingCFIUncheckedCallee = nullptr,
10219-
bool *AddingCFIUncheckedCallee = nullptr) const;
10211+
/// conversion of ExtInfo/ExtProtoInfo on the nested function type.
10212+
/// More precisely, this method checks whether FromType can be transformed
10213+
/// into an exact match for ToType, by transforming its extended function
10214+
/// type information in legal manner (e.g. by strictly stripping "noreturn"
10215+
/// or "noexcept", or by stripping "noescape" for arguments).
10216+
bool IsFunctionConversion(QualType FromType, QualType ToType) const;
1022010217

1022110218
/// Same as `IsFunctionConversion`, but if this would return true, it sets
1022210219
/// `ResultTy` to `ToType`.

clang/lib/ASTMatchers/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(LLVM_LINK_COMPONENTS
88
add_clang_library(clangASTMatchers
99
ASTMatchFinder.cpp
1010
ASTMatchersInternal.cpp
11-
GtestMatchers.cpp
1211
LowLevelHelpers.cpp
1312

1413
LINK_LIBS

0 commit comments

Comments
 (0)