Skip to content

Commit d84bfcd

Browse files
committed
better comment
Created using spr 1.3.6-beta.1
2 parents 0735048 + 4c2c177 commit d84bfcd

File tree

1,172 files changed

+69640
-39477
lines changed

Some content is hidden

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

1,172 files changed

+69640
-39477
lines changed

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ Example usage for a project using a compile commands database:
300300
llvm::StringMap<std::vector<StringRef>> USRToBitcode;
301301
Executor->get()->getToolResults()->forEachResult(
302302
[&](StringRef Key, StringRef Value) {
303-
auto R = USRToBitcode.try_emplace(Key, std::vector<StringRef>());
304-
R.first->second.emplace_back(Value);
303+
USRToBitcode[Key].emplace_back(Value);
305304
});
306305

307306
// Collects all Infos according to their unique USR value. This map is added

clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void CrtpConstructorAccessibilityCheck::check(
165165

166166
WithFriendHintIfNeeded(
167167
diag(Ctor->getLocation(),
168-
"%0 contructor allows the CRTP to be %select{inherited "
168+
"%0 constructor allows the CRTP to be %select{inherited "
169169
"from|constructed}1 as a regular template class; consider making "
170170
"it private%select{| and declaring the derived class as friend}2")
171171
<< Access << IsPublic << NeedsFriend

clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ SizeofExpressionCheck::SizeofExpressionCheck(StringRef Name,
7070
Options.get("WarnOnSizeOfCompareToConstant", true)),
7171
WarnOnSizeOfPointerToAggregate(
7272
Options.get("WarnOnSizeOfPointerToAggregate", true)),
73-
WarnOnSizeOfPointer(Options.get("WarnOnSizeOfPointer", false)) {}
73+
WarnOnSizeOfPointer(Options.get("WarnOnSizeOfPointer", false)),
74+
WarnOnOffsetDividedBySizeOf(
75+
Options.get("WarnOnOffsetDividedBySizeOf", true)) {}
7476

7577
void SizeofExpressionCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
7678
Options.store(Opts, "WarnOnSizeOfConstant", WarnOnSizeOfConstant);
@@ -82,6 +84,8 @@ void SizeofExpressionCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
8284
Options.store(Opts, "WarnOnSizeOfPointerToAggregate",
8385
WarnOnSizeOfPointerToAggregate);
8486
Options.store(Opts, "WarnOnSizeOfPointer", WarnOnSizeOfPointer);
87+
Options.store(Opts, "WarnOnOffsetDividedBySizeOf",
88+
WarnOnOffsetDividedBySizeOf);
8589
}
8690

8791
void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
@@ -307,7 +311,8 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
307311
offsetOfExpr()))
308312
.bind("sizeof-in-ptr-arithmetic-scale-expr");
309313
const auto PtrArithmeticIntegerScaleExpr = binaryOperator(
310-
hasAnyOperatorName("*", "/"),
314+
WarnOnOffsetDividedBySizeOf ? binaryOperator(hasAnyOperatorName("*", "/"))
315+
: binaryOperator(hasOperatorName("*")),
311316
// sizeof(...) * sizeof(...) and sizeof(...) / sizeof(...) is handled
312317
// by this check on another path.
313318
hasOperands(expr(hasType(isInteger()), unless(SizeofLikeScaleExpr)),

clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class SizeofExpressionCheck : public ClangTidyCheck {
3131
const bool WarnOnSizeOfCompareToConstant;
3232
const bool WarnOnSizeOfPointerToAggregate;
3333
const bool WarnOnSizeOfPointer;
34+
const bool WarnOnOffsetDividedBySizeOf;
3435
};
3536

3637
} // namespace clang::tidy::bugprone

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Changes in existing checks
158158
- Improved :doc:`bugprone-sizeof-expression
159159
<clang-tidy/checks/bugprone/sizeof-expression>` check to find suspicious
160160
usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or
161-
subtracting from a pointer.
161+
subtracting from a pointer directly or when used to scale a numeric value.
162162

163163
- Improved :doc:`bugprone-unchecked-optional-access
164164
<clang-tidy/checks/bugprone/unchecked-optional-access>` to support

clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ and the result is typically unintended, often out of bounds.
221221
``Ptr + sizeof(T)`` will offset the pointer by ``sizeof(T)`` elements,
222222
effectively exponentiating the scaling factor to the power of 2.
223223

224+
Similarly, multiplying or dividing a numeric value with the ``sizeof`` of an
225+
element or the whole buffer is suspicious, because the dimensional connection
226+
between the numeric value and the actual ``sizeof`` result can not always be
227+
deduced.
228+
While scaling an integer up (multiplying) with ``sizeof`` is likely **always**
229+
an issue, a scaling down (division) is not always inherently dangerous, in case
230+
the developer is aware that the division happens between an appropriate number
231+
of _bytes_ and a ``sizeof`` value.
232+
Turning :option:`WarnOnOffsetDividedBySizeOf` off will restrict the
233+
warnings to the multiplication case.
234+
224235
This case also checks suspicious ``alignof`` and ``offsetof`` usages in
225236
pointer arithmetic, as both return the "size" in bytes and not elements,
226237
potentially resulting in doubly-scaled offsets.
@@ -299,3 +310,9 @@ Options
299310
``sizeof`` is an expression that produces a pointer (except for a few
300311
idiomatic expressions that are probably intentional and correct).
301312
This detects occurrences of CWE 467. Default is `false`.
313+
314+
.. option:: WarnOnOffsetDividedBySizeOf
315+
316+
When `true`, the check will warn on pointer arithmetic where the
317+
element count is obtained from a division with ``sizeof(...)``,
318+
e.g., ``Ptr + Bytes / sizeof(*T)``. Default is `true`.

clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ template <typename T>
2626
class CRTP {
2727
public:
2828
CRTP() = default;
29-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
29+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
3030
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}public:
3131
// CHECK-FIXES: friend T;
3232
};
@@ -39,7 +39,7 @@ template <typename T>
3939
class CRTP {
4040
public:
4141
CRTP(int) {}
42-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
42+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
4343
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
4444
// CHECK-FIXES: friend T;
4545
};
@@ -52,10 +52,10 @@ template <typename T>
5252
class CRTP {
5353
public:
5454
CRTP(int) {}
55-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
55+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
5656
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
5757
CRTP(float) {}
58-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
58+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
5959
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) {}{{[[:space:]]*}}public:
6060

6161
// CHECK-FIXES: friend T;
@@ -70,13 +70,13 @@ template <typename T>
7070
class CRTP {
7171
protected:
7272
CRTP(int) {}
73-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
73+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
7474
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}protected:
7575
CRTP() = default;
76-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
76+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
7777
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}protected:
7878
CRTP(float) {}
79-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
79+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
8080
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) {}{{[[:space:]]*}}protected:
8181

8282
// CHECK-FIXES: friend T;
@@ -101,7 +101,7 @@ namespace struct_default_ctor {
101101
template <typename T>
102102
struct CRTP {
103103
CRTP() = default;
104-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
104+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
105105
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}public:
106106
// CHECK-FIXES: friend T;
107107
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- \
2+
// RUN: -config='{CheckOptions: { \
3+
// RUN: bugprone-sizeof-expression.WarnOnOffsetDividedBySizeOf: false \
4+
// RUN: }}'
5+
6+
typedef __SIZE_TYPE__ size_t;
7+
8+
void situational14(int *Buffer, size_t BufferSize) {
9+
int *P = &Buffer[0];
10+
while (P < Buffer + BufferSize / sizeof(*Buffer)) {
11+
// NO-WARNING: This test opted out of "P +- N */ sizeof(...)" warnings.
12+
++P;
13+
}
14+
}

clang-tools-extra/test/clang-tidy/checkers/bugprone/sizeof-expression-pointer-arithmetics.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,21 +352,30 @@ void good13(void) {
352352
int Buffer[BufferSize];
353353

354354
int *P = &Buffer[0];
355-
while (P < (Buffer + sizeof(Buffer) / sizeof(int))) {
355+
while (P < Buffer + sizeof(Buffer) / sizeof(int)) {
356356
// NO-WARNING: Calculating the element count of the buffer here, which is
357357
// safe with this idiom (as long as the types don't change).
358358
++P;
359359
}
360360

361-
while (P < (Buffer + sizeof(Buffer) / sizeof(Buffer[0]))) {
361+
while (P < Buffer + sizeof(Buffer) / sizeof(Buffer[0])) {
362362
// NO-WARNING: Calculating the element count of the buffer here, which is
363363
// safe with this idiom.
364364
++P;
365365
}
366366

367-
while (P < (Buffer + sizeof(Buffer) / sizeof(*P))) {
367+
while (P < Buffer + sizeof(Buffer) / sizeof(*P)) {
368368
// NO-WARNING: Calculating the element count of the buffer here, which is
369369
// safe with this idiom.
370370
++P;
371371
}
372372
}
373+
374+
void situational14(int *Buffer, size_t BufferSize) {
375+
int *P = &Buffer[0];
376+
while (P < Buffer + BufferSize / sizeof(*Buffer)) {
377+
// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: suspicious usage of 'sizeof(...)' in pointer arithmetic; this scaled value will be scaled again by the '+' operator
378+
// CHECK-MESSAGES: :[[@LINE-2]]:21: note: '+' in pointer arithmetic internally scales with 'sizeof(int)' == {{[0-9]+}}
379+
++P;
380+
}
381+
}

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ Bug Fixes to C++ Support
515515
- Fixed overload handling for object parameters with top-level cv-qualifiers in explicit member functions (#GH100394)
516516
- Fixed a bug in lambda captures where ``constexpr`` class-type objects were not properly considered ODR-used in
517517
certain situations. (#GH47400), (#GH90896)
518+
- Fix erroneous templated array size calculation leading to crashes in generated code. (#GH41441)
519+
- During the lookup for a base class name, non-type names are ignored. (#GH16855)
518520

519521
Bug Fixes to AST Handling
520522
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/OpenACCClause.h

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,6 @@ class OpenACCSeqClause : public OpenACCClause {
119119
}
120120
};
121121

122-
// Not yet implemented, but the type name is necessary for 'seq' diagnostics, so
123-
// this provides a basic, do-nothing implementation. We still need to add this
124-
// type to the visitors/etc, as well as get it to take its proper arguments.
125-
class OpenACCVectorClause : public OpenACCClause {
126-
protected:
127-
OpenACCVectorClause(SourceLocation BeginLoc, SourceLocation EndLoc)
128-
: OpenACCClause(OpenACCClauseKind::Vector, BeginLoc, EndLoc) {
129-
llvm_unreachable("Not yet implemented");
130-
}
131-
132-
public:
133-
static bool classof(const OpenACCClause *C) {
134-
return C->getClauseKind() == OpenACCClauseKind::Vector;
135-
}
136-
137-
static OpenACCVectorClause *
138-
Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
139-
140-
child_range children() {
141-
return child_range(child_iterator(), child_iterator());
142-
}
143-
const_child_range children() const {
144-
return const_child_range(const_child_iterator(), const_child_iterator());
145-
}
146-
};
147-
148122
/// Represents a clause that has a list of parameters.
149123
class OpenACCClauseWithParams : public OpenACCClause {
150124
/// Location of the '('.
@@ -531,6 +505,22 @@ class OpenACCWorkerClause : public OpenACCClauseWithSingleIntExpr {
531505
SourceLocation EndLoc);
532506
};
533507

508+
class OpenACCVectorClause : public OpenACCClauseWithSingleIntExpr {
509+
protected:
510+
OpenACCVectorClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
511+
Expr *IntExpr, SourceLocation EndLoc);
512+
513+
public:
514+
static bool classof(const OpenACCClause *C) {
515+
return C->getClauseKind() == OpenACCClauseKind::Vector;
516+
}
517+
518+
static OpenACCVectorClause *Create(const ASTContext &Ctx,
519+
SourceLocation BeginLoc,
520+
SourceLocation LParenLoc, Expr *IntExpr,
521+
SourceLocation EndLoc);
522+
};
523+
534524
class OpenACCNumWorkersClause : public OpenACCClauseWithSingleIntExpr {
535525
OpenACCNumWorkersClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
536526
Expr *IntExpr, SourceLocation EndLoc);

clang/include/clang/AST/Type.h

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,6 +2662,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
26622662
#include "clang/Basic/HLSLIntangibleTypes.def"
26632663
bool isHLSLSpecificType() const; // Any HLSL specific type
26642664
bool isHLSLIntangibleType() const; // Any HLSL intangible type
2665+
bool isHLSLAttributedResourceType() const;
26652666

26662667
/// Determines if this type, which must satisfy
26672668
/// isObjCLifetimeType(), is implicitly __unsafe_unretained rather
@@ -6270,6 +6271,14 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
62706271
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
62716272

62726273
Attributes() : Attributes(llvm::dxil::ResourceClass::UAV, false, false) {}
6274+
6275+
friend bool operator==(const Attributes &LHS, const Attributes &RHS) {
6276+
return std::tie(LHS.ResourceClass, LHS.IsROV, LHS.RawBuffer) ==
6277+
std::tie(RHS.ResourceClass, RHS.IsROV, RHS.RawBuffer);
6278+
}
6279+
friend bool operator!=(const Attributes &LHS, const Attributes &RHS) {
6280+
return !(LHS == RHS);
6281+
}
62736282
};
62746283

62756284
private:
@@ -6279,20 +6288,21 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
62796288
QualType ContainedType;
62806289
const Attributes Attrs;
62816290

6282-
HLSLAttributedResourceType(QualType Canon, QualType Wrapped,
6283-
QualType Contained, const Attributes &Attrs)
6284-
: Type(HLSLAttributedResource, Canon,
6291+
HLSLAttributedResourceType(QualType Wrapped, QualType Contained,
6292+
const Attributes &Attrs)
6293+
: Type(HLSLAttributedResource, QualType(),
62856294
Contained.isNull() ? TypeDependence::None
62866295
: Contained->getDependence()),
62876296
WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
62886297

62896298
public:
62906299
QualType getWrappedType() const { return WrappedType; }
62916300
QualType getContainedType() const { return ContainedType; }
6301+
bool hasContainedType() const { return !ContainedType.isNull(); }
62926302
const Attributes &getAttrs() const { return Attrs; }
62936303

6294-
bool isSugared() const { return true; }
6295-
QualType desugar() const { return getWrappedType(); }
6304+
bool isSugared() const { return false; }
6305+
QualType desugar() const { return QualType(this, 0); }
62966306

62976307
void Profile(llvm::FoldingSetNodeID &ID) {
62986308
Profile(ID, WrappedType, ContainedType, Attrs);
@@ -8436,17 +8446,19 @@ inline bool Type::isOpenCLSpecificType() const {
84368446
}
84378447
#include "clang/Basic/HLSLIntangibleTypes.def"
84388448

8439-
inline bool Type::isHLSLSpecificType() const {
8449+
inline bool Type::isHLSLIntangibleType() const {
84408450
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) is##Id##Type() ||
84418451
return
84428452
#include "clang/Basic/HLSLIntangibleTypes.def"
8443-
false; // end boolean or operation
8453+
isHLSLAttributedResourceType();
84448454
}
84458455

8446-
inline bool Type::isHLSLIntangibleType() const {
8447-
// All HLSL specific types are currently intangible type as well, but that
8448-
// might change in the future.
8449-
return isHLSLSpecificType();
8456+
inline bool Type::isHLSLSpecificType() const {
8457+
return isHLSLIntangibleType() || isa<HLSLAttributedResourceType>(this);
8458+
}
8459+
8460+
inline bool Type::isHLSLAttributedResourceType() const {
8461+
return isa<HLSLAttributedResourceType>(this);
84508462
}
84518463

84528464
inline bool Type::isTemplateTypeParmType() const {

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4761,6 +4761,12 @@ def HLSLWaveIsFirstLane : LangBuiltin<"HLSL_LANG"> {
47614761
let Prototype = "bool()";
47624762
}
47634763

4764+
def HLSLWaveReadLaneAt : LangBuiltin<"HLSL_LANG"> {
4765+
let Spellings = ["__builtin_hlsl_wave_read_lane_at"];
4766+
let Attributes = [NoThrow, Const];
4767+
let Prototype = "void(...)";
4768+
}
4769+
47644770
def HLSLClamp : LangBuiltin<"HLSL_LANG"> {
47654771
let Spellings = ["__builtin_hlsl_elementwise_clamp"];
47664772
let Attributes = [NoThrow, Const];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9230,6 +9230,8 @@ def err_typecheck_cond_incompatible_operands : Error<
92309230
def err_typecheck_expect_scalar_or_vector : Error<
92319231
"invalid operand of type %0 where %1 or "
92329232
"a vector of such type is required">;
9233+
def err_typecheck_expect_any_scalar_or_vector : Error<
9234+
"invalid operand of type %0 where a scalar or vector is required">;
92339235
def err_typecheck_expect_flt_or_vector : Error<
92349236
"invalid operand of type %0 where floating, complex or "
92359237
"a vector of such types is required">;
@@ -10124,6 +10126,8 @@ def note_lambda_capture_initializer : Note<
1012410126
" via initialization of lambda capture %0}1">;
1012510127
def note_init_with_default_member_initializer : Note<
1012610128
"initializing field %0 with default member initializer">;
10129+
def note_init_with_default_argument : Note<
10130+
"initializing parameter %0 with default argument">;
1012710131

1012810132
// Check for initializing a member variable with the address or a reference to
1012910133
// a constructor parameter.
@@ -12702,7 +12706,7 @@ def err_acc_gang_dim_value
1270212706
def err_acc_num_arg_conflict
1270312707
: Error<"'num' argument to '%0' clause not allowed on a 'loop' construct "
1270412708
"associated with a 'kernels' construct that has a "
12705-
"'%select{num_gangs|num_workers}1' "
12709+
"'%select{num_gangs|num_workers|vector_length}1' "
1270612710
"clause">;
1270712711
def err_acc_clause_in_clause_region
1270812712
: Error<"loop with a '%0' clause may not exist in the region of a '%1' "

clang/include/clang/Basic/OpenACCClauses.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ VISIT_CLAUSE(Reduction)
5454
VISIT_CLAUSE(Self)
5555
VISIT_CLAUSE(Seq)
5656
VISIT_CLAUSE(Tile)
57+
VISIT_CLAUSE(Vector)
5758
VISIT_CLAUSE(VectorLength)
5859
VISIT_CLAUSE(Wait)
5960
VISIT_CLAUSE(Worker)

0 commit comments

Comments
 (0)