Skip to content

Commit 9e2bfd5

Browse files
committed
rebase
Created using spr 1.3.4
2 parents 56c90a3 + 95caca8 commit 9e2bfd5

File tree

30 files changed

+1518
-260
lines changed

30 files changed

+1518
-260
lines changed

bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ f1:
1313
add x0, x0, #3
1414
ldp x29, x30, [sp], #16
1515
// autiasp
16-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block .LBB{{[0-9]+}}, at address
16+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block {{[0-9a-zA-Z.]+}}, at address
1717
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
1818
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
1919
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -66,7 +66,7 @@ f_intermediate_overwrite2:
6666
ldp x29, x30, [sp], #16
6767
autiasp
6868
mov x30, x0
69-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block .LBB{{[0-9]+}}, at address
69+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block {{[0-9a-zA-Z.]+}}, at address
7070
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
7171
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
7272
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x0
@@ -109,7 +109,7 @@ f_intermediate_overwrite3:
109109
ldp x29, x30, [sp], #16
110110
autiasp
111111
mov w30, w0
112-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block .LBB{{[0-9]+}}, at address
112+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block {{[0-9a-zA-Z.]+}}, at address
113113
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
114114
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
115115
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w30, w0
@@ -137,7 +137,7 @@ f_nonx30_ret:
137137
ldp x29, x30, [sp], #16
138138
mov x16, x30
139139
autiasp
140-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block .LBB{{[0-9]+}}, at address
140+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block {{[0-9a-zA-Z.]+}}, at address
141141
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret x16
142142
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
143143
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x16, x30
@@ -222,7 +222,7 @@ f_nonx30_ret_non_auted:
222222
.type f_callclobbered_x30,@function
223223
f_callclobbered_x30:
224224
bl g
225-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block .LBB{{[0-9]+}}, at address
225+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block {{[0-9a-zA-Z.]+}}, at address
226226
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
227227
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
228228
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
@@ -236,7 +236,7 @@ f_callclobbered_x30:
236236
.type f_callclobbered_calleesaved,@function
237237
f_callclobbered_calleesaved:
238238
bl g
239-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block .LBB{{[0-9]+}}, at address
239+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block {{[0-9a-zA-Z.]+}}, at address
240240
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret x19
241241
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
242242
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
@@ -325,7 +325,7 @@ f_autia1716:
325325
add x0, x0, #3
326326
ldp x29, x30, [sp], #16
327327
autia1716
328-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block .LBB{{[0-9]+}}, at address
328+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block {{[0-9a-zA-Z.]+}}, at address
329329
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
330330
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
331331
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -351,7 +351,7 @@ f_autib1716:
351351
add x0, x0, #3
352352
ldp x29, x30, [sp], #16
353353
autib1716
354-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block .LBB{{[0-9]+}}, at address
354+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block {{[0-9a-zA-Z.]+}}, at address
355355
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
356356
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
357357
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -377,7 +377,7 @@ f_autiax12:
377377
add x0, x0, #3
378378
ldp x29, x30, [sp], #16
379379
autia x12, sp
380-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block .LBB{{[0-9]+}}, at address
380+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block {{[0-9a-zA-Z.]+}}, at address
381381
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
382382
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
383383
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -403,7 +403,7 @@ f_autibx12:
403403
add x0, x0, #3
404404
ldp x29, x30, [sp], #16
405405
autib x12, sp
406-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block .LBB{{[0-9]+}}, at address
406+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block {{[0-9a-zA-Z.]+}}, at address
407407
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
408408
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
409409
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -458,7 +458,7 @@ f_autdax12:
458458
add x0, x0, #3
459459
ldp x29, x30, [sp], #16
460460
autda x12, sp
461-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block .LBB{{[0-9]+}}, at address
461+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block {{[0-9a-zA-Z.]+}}, at address
462462
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
463463
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
464464
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -484,7 +484,7 @@ f_autdbx12:
484484
add x0, x0, #3
485485
ldp x29, x30, [sp], #16
486486
autdb x12, sp
487-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block .LBB{{[0-9]+}}, at address
487+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block {{[0-9a-zA-Z.]+}}, at address
488488
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
489489
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
490490
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -539,7 +539,7 @@ f_autizax12:
539539
add x0, x0, #3
540540
ldp x29, x30, [sp], #16
541541
autiza x12
542-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block .LBB{{[0-9]+}}, at address
542+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block {{[0-9a-zA-Z.]+}}, at address
543543
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
544544
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
545545
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -565,7 +565,7 @@ f_autizbx12:
565565
add x0, x0, #3
566566
ldp x29, x30, [sp], #16
567567
autizb x12
568-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block .LBB{{[0-9]+}}, at address
568+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block {{[0-9a-zA-Z.]+}}, at address
569569
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
570570
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
571571
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -620,7 +620,7 @@ f_autdzax12:
620620
add x0, x0, #3
621621
ldp x29, x30, [sp], #16
622622
autdza x12
623-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block .LBB{{[0-9]+}}, at address
623+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block {{[0-9a-zA-Z.]+}}, at address
624624
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
625625
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
626626
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -646,7 +646,7 @@ f_autdzbx12:
646646
add x0, x0, #3
647647
ldp x29, x30, [sp], #16
648648
autdzb x12
649-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block .LBB{{[0-9]+}}, at address
649+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block {{[0-9a-zA-Z.]+}}, at address
650650
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
651651
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
652652
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -725,7 +725,7 @@ f_eretaa:
725725
bl g
726726
add x0, x0, #3
727727
ldp x29, x30, [sp], #16
728-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block .LBB{{[0-9]+}}, at address
728+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block {{[0-9a-zA-Z.]+}}, at address
729729
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eretaa
730730
eretaa
731731
.size f_eretaa, .-f_eretaa
@@ -739,7 +739,7 @@ f_eretab:
739739
bl g
740740
add x0, x0, #3
741741
ldp x29, x30, [sp], #16
742-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block .LBB{{[0-9]+}}, at address
742+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block {{[0-9a-zA-Z.]+}}, at address
743743
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eretab
744744
eretab
745745
.size f_eretab, .-f_eretab
@@ -753,15 +753,15 @@ f_eret:
753753
bl g
754754
add x0, x0, #3
755755
ldp x29, x30, [sp], #16
756-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block .LBB{{[0-9]+}}, at address
756+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block {{[0-9a-zA-Z.]+}}, at address
757757
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eret
758758
eret
759759
.size f_eret, .-f_eret
760760

761761
.globl f_movx30reg
762762
.type f_movx30reg,@function
763763
f_movx30reg:
764-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block .LBB{{[0-9]+}}, at address
764+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block {{[0-9a-zA-Z.]+}}, at address
765765
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
766766
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
767767
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x22
@@ -908,7 +908,7 @@ f_autia171615:
908908
add x0, x0, #3
909909
ldp x29, x30, [sp], #16
910910
autia171615
911-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block .LBB{{[0-9]+}}, at address
911+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block {{[0-9a-zA-Z.]+}}, at address
912912
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
913913
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
914914
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -934,7 +934,7 @@ f_autib171615:
934934
add x0, x0, #3
935935
ldp x29, x30, [sp], #16
936936
autib171615
937-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block .LBB{{[0-9]+}}, at address
937+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block {{[0-9a-zA-Z.]+}}, at address
938938
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
939939
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
940940
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10

bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ f_crossbb1:
1515
1:
1616
ret
1717
.size f_crossbb1, .-f_crossbb1
18-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block .L{{[^,]+}}, at address
18+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block {{[^,]+}}, at address
1919
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
2020
// CHECK-NEXT: The 2 instructions that write to the return register after any authentication are:
2121
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -37,7 +37,7 @@ f_mergebb1:
3737
1:
3838
ret
3939
.size f_mergebb1, .-f_mergebb1
40-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block .L{{[^,]+}}, at address
40+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block {{[^,]+}}, at address
4141
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
4242
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
4343
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10

clang/docs/analyzer/checkers.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,6 +3668,51 @@ Here are some examples of situations that we warn about as they *might* be poten
36683668
RefCountable* uncounted = counted.get(); // warn
36693669
}
36703670
3671+
alpha.webkit.UnretainedLocalVarsChecker
3672+
"""""""""""""""""""""""""""""""""""""""
3673+
The goal of this rule is to make sure that any NS or CF local variable is backed by a RetainPtr with lifetime that is strictly larger than the scope of the unretained local variable. To be on the safe side we require the scope of an unretained variable to be embedded in the scope of Retainptr object that backs it.
3674+
3675+
The rules of when to use and not to use RetainPtr are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
3676+
3677+
These are examples of cases that we consider safe:
3678+
3679+
.. code-block:: cpp
3680+
3681+
void foo1() {
3682+
RetainPtr<NSObject> retained;
3683+
// The scope of unretained is EMBEDDED in the scope of retained.
3684+
{
3685+
NSObject* unretained = retained.get(); // ok
3686+
}
3687+
}
3688+
3689+
void foo2(RetainPtr<NSObject> retained_param) {
3690+
NSObject* unretained = retained_param.get(); // ok
3691+
}
3692+
3693+
void FooClass::foo_method() {
3694+
NSObject* unretained = this; // ok
3695+
}
3696+
3697+
Here are some examples of situations that we warn about as they *might* be potentially unsafe. The logic is that either we're able to guarantee that a local variable is safe or it's considered unsafe.
3698+
3699+
.. code-block:: cpp
3700+
3701+
void foo1() {
3702+
NSObject* unretained = [[NSObject alloc] init]; // warn
3703+
}
3704+
3705+
NSObject* global_unretained;
3706+
void foo2() {
3707+
NSObject* unretained = global_unretained; // warn
3708+
}
3709+
3710+
void foo3() {
3711+
RetainPtr<NSObject> retained;
3712+
// The scope of unretained is not EMBEDDED in the scope of retained.
3713+
NSObject* unretained = retained.get(); // warn
3714+
}
3715+
36713716
Debug Checkers
36723717
---------------
36733718

clang/include/clang/AST/DeclCXX.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,14 +1720,6 @@ class CXXRecordDecl : public RecordDecl {
17201720
/// static analysis, or similar.
17211721
bool hasMemberName(DeclarationName N) const;
17221722

1723-
/// Performs an imprecise lookup of a dependent name in this class.
1724-
///
1725-
/// This function does not follow strict semantic rules and should be used
1726-
/// only when lookup rules can be relaxed, e.g. indexing.
1727-
std::vector<const NamedDecl *>
1728-
lookupDependentName(DeclarationName Name,
1729-
llvm::function_ref<bool(const NamedDecl *ND)> Filter);
1730-
17311723
/// Renders and displays an inheritance diagram
17321724
/// for this C++ class and all of its base classes (transitively) using
17331725
/// GraphViz.

clang/include/clang/Basic/LangOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ class LangOptions : public LangOptionsBase {
816816
VisibilityForcedKinds::ForceHidden;
817817
}
818818

819+
bool allowArrayReturnTypes() const { return HLSL; }
820+
819821
/// Remap path prefix according to -fmacro-prefix-path option.
820822
void remapPathPrefix(SmallVectorImpl<char> &Path) const;
821823

clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,4 +1782,8 @@ def UncheckedLocalVarsChecker : Checker<"UncheckedLocalVarsChecker">,
17821782
HelpText<"Check unchecked local variables.">,
17831783
Documentation<HasDocumentation>;
17841784

1785+
def UnretainedLocalVarsChecker : Checker<"UnretainedLocalVarsChecker">,
1786+
HelpText<"Check unretained local variables.">,
1787+
Documentation<HasDocumentation>;
1788+
17851789
} // end alpha.webkit

clang/lib/AST/CXXInheritance.cpp

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -411,59 +411,6 @@ bool CXXRecordDecl::hasMemberName(DeclarationName Name) const {
411411
Paths);
412412
}
413413

414-
static bool
415-
findOrdinaryMemberInDependentClasses(const CXXBaseSpecifier *Specifier,
416-
CXXBasePath &Path, DeclarationName Name) {
417-
const TemplateSpecializationType *TST =
418-
Specifier->getType()->getAs<TemplateSpecializationType>();
419-
if (!TST) {
420-
auto *RT = Specifier->getType()->getAs<RecordType>();
421-
if (!RT)
422-
return false;
423-
return findOrdinaryMember(cast<CXXRecordDecl>(RT->getDecl()), Path, Name);
424-
}
425-
TemplateName TN = TST->getTemplateName();
426-
const auto *TD = dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl());
427-
if (!TD)
428-
return false;
429-
CXXRecordDecl *RD = TD->getTemplatedDecl();
430-
if (!RD)
431-
return false;
432-
return findOrdinaryMember(RD, Path, Name);
433-
}
434-
435-
std::vector<const NamedDecl *> CXXRecordDecl::lookupDependentName(
436-
DeclarationName Name,
437-
llvm::function_ref<bool(const NamedDecl *ND)> Filter) {
438-
std::vector<const NamedDecl *> Results;
439-
// Lookup in the class.
440-
bool AnyOrdinaryMembers = false;
441-
for (const NamedDecl *ND : lookup(Name)) {
442-
if (isOrdinaryMember(ND))
443-
AnyOrdinaryMembers = true;
444-
if (Filter(ND))
445-
Results.push_back(ND);
446-
}
447-
if (AnyOrdinaryMembers)
448-
return Results;
449-
450-
// Perform lookup into our base classes.
451-
CXXBasePaths Paths;
452-
Paths.setOrigin(this);
453-
if (!lookupInBases(
454-
[&](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) {
455-
return findOrdinaryMemberInDependentClasses(Specifier, Path, Name);
456-
},
457-
Paths, /*LookupInDependent=*/true))
458-
return Results;
459-
for (DeclContext::lookup_iterator I = Paths.front().Decls, E = I.end();
460-
I != E; ++I) {
461-
if (isOrdinaryMember(*I) && Filter(*I))
462-
Results.push_back(*I);
463-
}
464-
return Results;
465-
}
466-
467414
void OverridingMethods::add(unsigned OverriddenSubobject,
468415
UniqueVirtualMethod Overriding) {
469416
SmallVectorImpl<UniqueVirtualMethod> &SubobjectOverrides

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20679,7 +20679,8 @@ ExprResult RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) {
2067920679
const FunctionType *FnType = CalleeType->castAs<FunctionType>();
2068020680

2068120681
// Verify that this is a legal result type of a function.
20682-
if (DestType->isArrayType() || DestType->isFunctionType()) {
20682+
if ((DestType->isArrayType() && !S.getLangOpts().allowArrayReturnTypes()) ||
20683+
DestType->isFunctionType()) {
2068320684
unsigned diagID = diag::err_func_returning_array_function;
2068420685
if (Kind == FK_BlockPointer)
2068520686
diagID = diag::err_block_returning_array_function;

0 commit comments

Comments
 (0)