let Component = "Sema" in {
let CategoryName = "Semantic Issue" in {
+def note_previous_decl : Note<"%0 declared here">;
+def note_entity_declared_at : Note<"%0 declared here">;
+def note_callee_decl : Note<"%0 declared here">;
+def note_defined_here : Note<"%0 defined here">;
+
// For loop analysis
def warn_variables_not_in_loop_body : Warning<
"variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
"call to pure virtual member function %0; overrides of %0 in subclasses are "
"not available in the %select{constructor|destructor}1 of %2">;
-def note_field_decl : Note<"member is declared here">;
+def note_member_declared_at : Note<"member is declared here">;
def note_ivar_decl : Note<"instance variable is declared here">;
def note_bitfield_decl : Note<"bit-field is declared here">;
-def note_previous_decl : Note<"%0 declared here">;
def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
def note_member_synthesized_at : Note<
"implicit %select{default constructor|copy constructor|move constructor|copy "
"%select{class template|function template|template template parameter"
"|template}1 %2">;
def note_template_decl_here : Note<"template is declared here">;
-def note_member_of_template_here : Note<"member is declared here">;
def err_template_arg_must_be_type : Error<
"template argument for template type parameter must be a type">;
def err_template_arg_must_be_type_suggest : Error<
"in different files">, InGroup<StaticLocalInInline>;
def note_convert_inline_to_static : Note<
"use 'static' to give inline function %0 internal linkage">;
-def note_internal_decl_declared_here : Note<
- "%0 declared here">;
def warn_redefinition_of_typedef : ExtWarn<
"redefinition of typedef %0 is a C11 feature">,
def err_expected_class_or_namespace : Error<"%0 is not a class"
"%select{ or namespace|, namespace, or scoped enumeration}1">;
-def note_expected_class_or_namespace_declared_here : Note<
- "%0 declared here">;
def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
"because namespace %1 does not enclose namespace %2">;
def err_invalid_declarator_global_scope : Error<
"calling function with incomplete return type %0">;
def err_call_function_incomplete_return : Error<
"calling %0 with incomplete return type %1">;
-def note_function_with_incomplete_return_type_declared_here : Note<
- "%0 declared here">;
def err_call_incomplete_argument : Error<
"argument type %0 is incomplete">;
def err_typecheck_call_too_few_args : Error<
"incompatible pointer types passing retainable parameter of type %0"
"to a CF function expecting %1 type">;
-def note_callee_decl : Note<
- "%0 declared here">;
-def note_defined_here : Note<"%0 defined here">;
-
def err_builtin_fn_use : Error<"builtin functions must be directly called">;
def warn_call_wrong_number_of_arguments : Warning<
def err_reference_to_local_var_in_enclosing_context : Error<
"reference to local variable %0 declared in enclosing context">;
-def note_local_variable_declared_here : Note<
- "%0 declared here">;
def err_static_data_member_not_allowed_in_local_class : Error<
"static data member %0 not allowed in local class %1">;
<< (base->getAccessSpecifierAsWritten() == AS_none);
if (entity.isMemberAccess())
- S.Diag(entity.getTargetDecl()->getLocation(), diag::note_field_decl);
+ S.Diag(entity.getTargetDecl()->getLocation(),
+ diag::note_member_declared_at);
}
static void DiagnoseBadAccess(Sema &S, SourceLocation Loc,
Diag(R.getNameLoc(), diag::err_expected_class_or_namespace)
<< &Identifier << getLangOpts().CPlusPlus;
if (NamedDecl *ND = R.getAsSingle<NamedDecl>())
- Diag(ND->getLocation(),
- diag::note_expected_class_or_namespace_declared_here)
- << &Identifier;
+ Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
return true;
}
}
Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
<< &Identifier << getLangOpts().CPlusPlus;
if (NamedDecl *ND = Found.getAsSingle<NamedDecl>())
- Diag(ND->getLocation(),
- diag::note_expected_class_or_namespace_declared_here)
- << &Identifier;
+ Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
}
} else if (SS.isSet())
Diag(IdentifierLoc, diag::err_no_member) << &Identifier << LookupCtx
Diag(BaseLoc, diag::err_class_marked_final_used_as_base)
<< CXXBaseDecl->getDeclName()
<< FA->isSpelledAsSealed();
- Diag(CXXBaseDecl->getLocation(), diag::note_previous_decl)
- << CXXBaseDecl->getDeclName();
+ Diag(CXXBaseDecl->getLocation(), diag::note_entity_declared_at)
+ << CXXBaseDecl->getDeclName() << FA->getRange();
return nullptr;
}
S.MaybeSuggestAddingStaticToDecl(Current);
- S.Diag(D->getCanonicalDecl()->getLocation(),
- diag::note_internal_decl_declared_here)
- << D;
+ S.Diag(D->getCanonicalDecl()->getLocation(), diag::note_entity_declared_at)
+ << D;
}
void Sema::MaybeSuggestAddingStaticToDecl(const FunctionDecl *Cur) {
<< var->getIdentifier();
}
- S.Diag(var->getLocation(), diag::note_local_variable_declared_here)
- << var->getIdentifier();
+ S.Diag(var->getLocation(), diag::note_entity_declared_at)
+ << var->getIdentifier();
// FIXME: Add additional diagnostic info about class etc. which prevents
// capture.
S.Diag(Loc, diag::err_call_function_incomplete_return)
<< CE->getSourceRange() << FD->getDeclName() << T;
- S.Diag(FD->getLocation(),
- diag::note_function_with_incomplete_return_type_declared_here)
- << FD->getDeclName();
+ S.Diag(FD->getLocation(), diag::note_entity_declared_at)
+ << FD->getDeclName();
}
} Diagnoser(FD, CE);
<< S.Context.getTypeDeclType(Constructor->getParent())
<< /*member=*/1
<< Entity.getName();
- S.Diag(Entity.getDecl()->getLocation(), diag::note_field_decl);
+ S.Diag(Entity.getDecl()->getLocation(),
+ diag::note_member_declared_at);
if (const RecordType *Record
= Entity.getType()->getAs<RecordType>())
S.Diag(PointOfInstantiation,
diag::err_implicit_instantiate_member_undefined)
<< S.Context.getTypeDeclType(Instantiation);
- S.Diag(Pattern->getLocation(), diag::note_member_of_template_here);
+ S.Diag(Pattern->getLocation(), diag::note_member_declared_at);
} else {
S.Diag(PointOfInstantiation, diag::err_template_instantiate_undefined)
<< (TSK != TSK_ImplicitInstantiation)