Skip to content

Commit 349af37

Browse files
authored
Merge pull request #40305 from compnerd/semitruck
gardening: make c++98-compat-extra-semi an error
2 parents 34267d7 + cbd0441 commit 349af37

Some content is hidden

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

61 files changed

+99
-93
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,12 @@ if(CMAKE_C_COMPILER_ID MATCHES Clang)
494494
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-Werror=gnu>)
495495
endif()
496496

497+
# Make some warnings errors as they are commonly occurring and flood the build
498+
# with unnecessary noise.
499+
if(CMAKE_C_COMPILER_ID MATCHES Clang)
500+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Werror=c++98-compat-extra-semi>)
501+
endif()
502+
497503
# Use dispatch as the system scheduler by default.
498504
# For convenience, we set this to false when concurrency is disabled.
499505
set(SWIFT_CONCURRENCY_USES_DISPATCH FALSE)

include/swift/AST/ExtInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ convertRepresentation(FunctionTypeRepresentation rep) {
221221
return SILFunctionTypeRepresentation::CFunctionPointer;
222222
}
223223
llvm_unreachable("Unhandled FunctionTypeRepresentation!");
224-
};
224+
}
225225

226226
inline Optional<FunctionTypeRepresentation>
227227
convertRepresentation(SILFunctionTypeRepresentation rep) {
@@ -241,7 +241,7 @@ convertRepresentation(SILFunctionTypeRepresentation rep) {
241241
return None;
242242
}
243243
llvm_unreachable("Unhandled SILFunctionTypeRepresentation!");
244-
};
244+
}
245245

246246
/// Can this calling convention result in a function being called indirectly
247247
/// through the runtime.

include/swift/AST/IRGenRequests.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class TBDGenDescriptor;
3535

3636
namespace irgen {
3737
class IRGenModule;
38-
};
38+
}
3939

4040
namespace Lowering {
4141
class TypeConverter;
42-
};
42+
}
4343

44-
}; // namespace swift
44+
} // namespace swift
4545

4646
namespace llvm {
4747
class GlobalVariable;
@@ -51,9 +51,9 @@ class TargetMachine;
5151

5252
namespace orc {
5353
class ThreadSafeModule;
54-
}; // namespace orc
54+
} // namespace orc
5555

56-
}; // namespace llvm
56+
} // namespace llvm
5757

5858
namespace swift {
5959

include/swift/AST/Stmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ inline void simple_display(llvm::raw_ostream &out, Stmt *S) {
13961396
out << Stmt::getKindName(S->getKind());
13971397
else
13981398
out << "(null)";
1399-
};
1399+
}
14001400

14011401
} // end namespace swift
14021402

include/swift/AST/TypeAlignments.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ LLVM_DECLARE_TYPE_ALIGNMENT(swift::SILFunctionType,
124124
LLVM_DECLARE_TYPE_ALIGNMENT(swift::Stmt, swift::StmtAlignInBits)
125125
LLVM_DECLARE_TYPE_ALIGNMENT(swift::BraceStmt, swift::StmtAlignInBits)
126126

127-
LLVM_DECLARE_TYPE_ALIGNMENT(swift::ASTContext, swift::ASTContextAlignInBits);
127+
LLVM_DECLARE_TYPE_ALIGNMENT(swift::ASTContext, swift::ASTContextAlignInBits)
128128
LLVM_DECLARE_TYPE_ALIGNMENT(swift::DeclContext, swift::DeclContextAlignInBits)
129129
LLVM_DECLARE_TYPE_ALIGNMENT(swift::FileUnit, swift::DeclContextAlignInBits)
130130
LLVM_DECLARE_TYPE_ALIGNMENT(swift::DifferentiableAttr, swift::PointerAlignInBits)
@@ -153,7 +153,7 @@ LLVM_DECLARE_TYPE_ALIGNMENT(swift::AttributeBase, swift::AttrAlignInBits)
153153

154154
LLVM_DECLARE_TYPE_ALIGNMENT(swift::TypeRepr, swift::TypeReprAlignInBits)
155155

156-
LLVM_DECLARE_TYPE_ALIGNMENT(swift::CaseLabelItem, swift::PatternAlignInBits);
156+
LLVM_DECLARE_TYPE_ALIGNMENT(swift::CaseLabelItem, swift::PatternAlignInBits)
157157

158158
static_assert(alignof(void*) >= 2, "pointer alignment is too small");
159159

include/swift/AST/Types.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ class BuiltinRawPointerType : public BuiltinType {
14161416
return T->getKind() == TypeKind::BuiltinRawPointer;
14171417
}
14181418
};
1419-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinRawPointerType, BuiltinType);
1419+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinRawPointerType, BuiltinType)
14201420

14211421
/// BuiltinRawContinuationType - The builtin raw unsafe continuation type.
14221422
/// In C, this is a non-null AsyncTask*. This pointer is completely
@@ -1431,7 +1431,7 @@ class BuiltinRawUnsafeContinuationType : public BuiltinType {
14311431
return T->getKind() == TypeKind::BuiltinRawUnsafeContinuation;
14321432
}
14331433
};
1434-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinRawUnsafeContinuationType, BuiltinType);
1434+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinRawUnsafeContinuationType, BuiltinType)
14351435

14361436
/// BuiltinExecutorType - The builtin executor-ref type. In C, this
14371437
/// is the ExecutorRef struct type.
@@ -1444,7 +1444,7 @@ class BuiltinExecutorType : public BuiltinType {
14441444
return T->getKind() == TypeKind::BuiltinExecutor;
14451445
}
14461446
};
1447-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinExecutorType, BuiltinType);
1447+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinExecutorType, BuiltinType)
14481448

14491449
/// BuiltinJobType - The builtin job type. In C, this is a
14501450
/// non-null Job*. This pointer is completely unmanaged (the unscheduled
@@ -1458,7 +1458,7 @@ class BuiltinJobType : public BuiltinType {
14581458
return T->getKind() == TypeKind::BuiltinJob;
14591459
}
14601460
};
1461-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinJobType, BuiltinType);
1461+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinJobType, BuiltinType)
14621462

14631463
/// BuiltinDefaultActorStorageType - The type of the stored property
14641464
/// that's added implicitly to default actors. No C equivalent because
@@ -1474,7 +1474,7 @@ class BuiltinDefaultActorStorageType : public BuiltinType {
14741474
return T->getKind() == TypeKind::BuiltinDefaultActorStorage;
14751475
}
14761476
};
1477-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinDefaultActorStorageType, BuiltinType);
1477+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinDefaultActorStorageType, BuiltinType)
14781478

14791479
/// BuiltinNativeObjectType - The builtin opaque object-pointer type.
14801480
/// Useful for keeping an object alive when it is otherwise being
@@ -1488,7 +1488,7 @@ class BuiltinNativeObjectType : public BuiltinType {
14881488
return T->getKind() == TypeKind::BuiltinNativeObject;
14891489
}
14901490
};
1491-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinNativeObjectType, BuiltinType);
1491+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinNativeObjectType, BuiltinType)
14921492

14931493
/// A type that contains an owning reference to a heap object packed with
14941494
/// additional bits. The type uses a bit to discriminate native Swift objects
@@ -1502,7 +1502,7 @@ class BuiltinBridgeObjectType : public BuiltinType {
15021502
return T->getKind() == TypeKind::BuiltinBridgeObject;
15031503
}
15041504
};
1505-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinBridgeObjectType, BuiltinType);
1505+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinBridgeObjectType, BuiltinType)
15061506

15071507
/// BuiltinUnsafeValueBufferType - The builtin opaque fixed-size value
15081508
/// buffer type, into which storage for an arbitrary value can be
@@ -1521,7 +1521,7 @@ class BuiltinUnsafeValueBufferType : public BuiltinType {
15211521
return T->getKind() == TypeKind::BuiltinUnsafeValueBuffer;
15221522
}
15231523
};
1524-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinUnsafeValueBufferType, BuiltinType);
1524+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinUnsafeValueBufferType, BuiltinType)
15251525

15261526
/// A builtin vector type.
15271527
class BuiltinVectorType : public BuiltinType, public llvm::FoldingSetNode {
@@ -1752,7 +1752,7 @@ class BuiltinIntegerLiteralType : public AnyBuiltinIntegerType {
17521752

17531753
BuiltinIntegerWidth getWidth() const = delete;
17541754
};
1755-
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinIntegerLiteralType, AnyBuiltinIntegerType);
1755+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinIntegerLiteralType, AnyBuiltinIntegerType)
17561756

17571757
inline BuiltinIntegerWidth AnyBuiltinIntegerType::getWidth() const {
17581758
if (auto intTy = dyn_cast<BuiltinIntegerType>(this)) {
@@ -4119,7 +4119,7 @@ substOpaqueTypesWithUnderlyingTypes(ProtocolConformanceRef ref, Type origType,
41194119
TypeExpansionContext context);
41204120
namespace Lowering {
41214121
class TypeConverter;
4122-
};
4122+
}
41234123

41244124
/// SILFunctionType - The lowered type of a function value, suitable
41254125
/// for use by SIL.

include/swift/Basic/Fingerprint.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace llvm {
2424
namespace yaml {
2525
class IO;
2626
}
27-
}; // namespace llvm
27+
} // namespace llvm
2828

2929
namespace swift {
3030

@@ -118,7 +118,7 @@ class Fingerprint final {
118118
};
119119

120120
void simple_display(llvm::raw_ostream &out, const Fingerprint &fp);
121-
}; // namespace swift
121+
} // namespace swift
122122

123123
namespace swift {
124124

@@ -134,11 +134,11 @@ template <> struct StableHasher::Combiner<Fingerprint> {
134134
}
135135
};
136136

137-
}; // namespace swift
137+
} // namespace swift
138138

139139
namespace llvm {
140140
class raw_ostream;
141141
raw_ostream &operator<<(raw_ostream &OS, const swift::Fingerprint &fp);
142-
}; // namespace llvm
142+
} // namespace llvm
143143

144144
#endif // SWIFT_BASIC_FINGERPRINT_H

include/swift/Runtime/InstrumentsSupport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ size_t _swift_indexToSize(size_t idx);
6060
SWIFT_RUNTIME_EXPORT
6161
void _swift_zone_init(void);
6262

63-
};
63+
}
6464

6565
#endif

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ SDKNodeDeclImport::SDKNodeDeclImport(SDKNodeInitInfo Info):
179179
SDKNodeDecl(Info, SDKNodeKind::DeclImport) {}
180180

181181
SDKNodeDeclAssociatedType::SDKNodeDeclAssociatedType(SDKNodeInitInfo Info):
182-
SDKNodeDecl(Info, SDKNodeKind::DeclAssociatedType) {};
182+
SDKNodeDecl(Info, SDKNodeKind::DeclAssociatedType) {}
183183

184184
SDKNodeDeclSubscript::SDKNodeDeclSubscript(SDKNodeInitInfo Info):
185185
SDKNodeDeclAbstractFunc(Info, SDKNodeKind::DeclSubscript),

lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,7 @@ namespace {
17421742
static StringRef
17431743
pathStringFromFrameworkSearchPath(const SearchPathOptions::FrameworkSearchPath &next) {
17441744
return next.Path;
1745-
};
1745+
}
17461746
}
17471747

17481748
std::vector<std::string> ASTContext::getDarwinImplicitFrameworkSearchPaths()

0 commit comments

Comments
 (0)