Skip to content

Commit 0f7e8c9

Browse files
committed
don't support c++
Signed-off-by: Justin Stitt <[email protected]>
1 parent 6794e45 commit 0f7e8c9

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4508,7 +4508,7 @@ def CodeAlign: StmtAttr {
45084508
}
45094509

45104510
def Wraps : DeclOrTypeAttr {
4511-
let Spellings = [Clang<"wraps">, CXX11<"", "wraps", 202403>];
4511+
let Spellings = [GNU<"wraps">];
45124512
let Subjects = SubjectList<[Var, TypedefName, Field]>;
45134513
let Documentation = [WrapsDocs];
45144514
}

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,6 +4414,11 @@ void Sema::AddAlignValueAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E) {
44144414
}
44154415

44164416
static void handleWrapsAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
4417+
if (S.getLangOpts().CPlusPlus) {
4418+
S.Diag(AL.getLoc(), diag::warn_attribute_ignored) << AL;
4419+
return;
4420+
}
4421+
44174422
S.AddWrapsAttr(D, AL);
44184423
}
44194424

clang/lib/Sema/SemaType.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6959,6 +6959,11 @@ static void handleWrapsAttr(QualType &Type, const ParsedAttr &Attr,
69596959
Sema &S = State.getSema();
69606960
ASTContext &Ctx = S.Context;
69616961

6962+
// No need to warn here, that is handled by SemaDeclAttr.
6963+
// Simply disable applying this attribute.
6964+
if (S.getLangOpts().CPlusPlus)
6965+
return;
6966+
69626967
if (!Type->isIntegerType())
69636968
S.Diag(Attr.getLoc(), diag::warn_wraps_attr_var_decl_type_not_integer)
69646969
<< Type.getAsString();

0 commit comments

Comments
 (0)