зеркало из https://github.com/microsoft/clang-1.git
remove some extraneous syntax: sourceloc implicitly converts to sourcerange.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90710 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
86b85b2034
Коммит
29d9c1adfa
|
@ -1616,7 +1616,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
|
|||
// Check for extraneous top-level semicolon.
|
||||
if (Tok.is(tok::semi)) {
|
||||
Diag(Tok, diag::ext_extra_struct_semi)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(Tok.getLocation()));
|
||||
<< CodeModificationHint::CreateRemoval(Tok.getLocation());
|
||||
ConsumeToken();
|
||||
continue;
|
||||
}
|
||||
|
@ -1841,7 +1841,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclPtrTy EnumDecl) {
|
|||
!(getLang().C99 || getLang().CPlusPlus0x))
|
||||
Diag(CommaLoc, diag::ext_enumerator_list_comma)
|
||||
<< getLang().CPlusPlus
|
||||
<< CodeModificationHint::CreateRemoval((SourceRange(CommaLoc)));
|
||||
<< CodeModificationHint::CreateRemoval(CommaLoc);
|
||||
}
|
||||
|
||||
// Eat the }.
|
||||
|
|
|
@ -954,7 +954,7 @@ Parser::BaseResult Parser::ParseBaseSpecifier(DeclPtrTy ClassDecl) {
|
|||
if (IsVirtual) {
|
||||
// Complain about duplicate 'virtual'
|
||||
Diag(VirtualLoc, diag::err_dup_virtual)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(VirtualLoc));
|
||||
<< CodeModificationHint::CreateRemoval(VirtualLoc);
|
||||
}
|
||||
|
||||
IsVirtual = true;
|
||||
|
@ -1349,7 +1349,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
|
|||
// Check for extraneous top-level semicolon.
|
||||
if (Tok.is(tok::semi)) {
|
||||
Diag(Tok, diag::ext_extra_struct_semi)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(Tok.getLocation()));
|
||||
<< CodeModificationHint::CreateRemoval(Tok.getLocation());
|
||||
ConsumeToken();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -942,7 +942,7 @@ void Parser::ParseObjCClassInstanceVariables(DeclPtrTy interfaceDecl,
|
|||
// Check for extraneous top-level semicolon.
|
||||
if (Tok.is(tok::semi)) {
|
||||
Diag(Tok, diag::ext_extra_struct_semi)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(Tok.getLocation()));
|
||||
<< CodeModificationHint::CreateRemoval(Tok.getLocation());
|
||||
ConsumeToken();
|
||||
continue;
|
||||
}
|
||||
|
@ -1507,7 +1507,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDefinition() {
|
|||
if (Tok.is(tok::semi)) {
|
||||
if (ObjCImpDecl) {
|
||||
Diag(Tok, diag::warn_semicolon_before_method_body)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(Tok.getLocation()));
|
||||
<< CodeModificationHint::CreateRemoval(Tok.getLocation());
|
||||
}
|
||||
ConsumeToken();
|
||||
}
|
||||
|
|
|
@ -405,7 +405,7 @@ Parser::DeclGroupPtrTy Parser::ParseExternalDeclaration(CXX0XAttributeList Attr)
|
|||
case tok::semi:
|
||||
if (!getLang().CPlusPlus0x)
|
||||
Diag(Tok, diag::ext_top_level_semi)
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(Tok.getLocation()));
|
||||
<< CodeModificationHint::CreateRemoval(Tok.getLocation());
|
||||
|
||||
ConsumeToken();
|
||||
// TODO: Invoke action for top-level semicolon.
|
||||
|
|
|
@ -2327,7 +2327,7 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
|
||||
diag::err_static_out_of_line)
|
||||
<< CodeModificationHint::CreateRemoval(
|
||||
SourceRange(D.getDeclSpec().getStorageClassSpecLoc()));
|
||||
D.getDeclSpec().getStorageClassSpecLoc());
|
||||
} else if (SC == VarDecl::None)
|
||||
SC = VarDecl::Static;
|
||||
}
|
||||
|
@ -2849,7 +2849,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
// 'virtual' was specified outside of the class.
|
||||
Diag(D.getDeclSpec().getVirtualSpecLoc(), diag::err_virtual_out_of_class)
|
||||
<< CodeModificationHint::CreateRemoval(
|
||||
SourceRange(D.getDeclSpec().getVirtualSpecLoc()));
|
||||
D.getDeclSpec().getVirtualSpecLoc());
|
||||
} else {
|
||||
// Okay: Add virtual to the method.
|
||||
CXXRecordDecl *CurClass = cast<CXXRecordDecl>(DC);
|
||||
|
@ -2889,7 +2889,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
|
||||
diag::err_static_out_of_line)
|
||||
<< CodeModificationHint::CreateRemoval(
|
||||
SourceRange(D.getDeclSpec().getStorageClassSpecLoc()));
|
||||
D.getDeclSpec().getStorageClassSpecLoc());
|
||||
}
|
||||
|
||||
// Handle GNU asm-label extension (encoded as an attribute).
|
||||
|
|
|
@ -637,8 +637,8 @@ void InitListChecker::CheckExplicitInitList(InitListExpr *IList, QualType &T,
|
|||
if (T->isScalarType() && !TopLevelObject)
|
||||
SemaRef.Diag(IList->getLocStart(), diag::warn_braces_around_scalar_init)
|
||||
<< IList->getSourceRange()
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(IList->getLocStart()))
|
||||
<< CodeModificationHint::CreateRemoval(SourceRange(IList->getLocEnd()));
|
||||
<< CodeModificationHint::CreateRemoval(IList->getLocStart())
|
||||
<< CodeModificationHint::CreateRemoval(IList->getLocEnd());
|
||||
}
|
||||
|
||||
void InitListChecker::CheckListElementTypes(InitListExpr *IList,
|
||||
|
|
|
@ -4373,8 +4373,7 @@ Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
|
|||
if (D.getDeclSpec().isInlineSpecified() && getLangOptions().CPlusPlus0x)
|
||||
Diag(D.getDeclSpec().getInlineSpecLoc(),
|
||||
diag::err_explicit_instantiation_inline)
|
||||
<< CodeModificationHint::CreateRemoval(
|
||||
SourceRange(D.getDeclSpec().getInlineSpecLoc()));
|
||||
<<CodeModificationHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
|
||||
|
||||
// FIXME: check for constexpr specifier.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче