From: Richard Trieu Date: Wed, 28 Mar 2018 04:16:13 +0000 (+0000) Subject: Fix some handling of AST nodes with diagnostics. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cab3257e74b0f7c1c6255c8e9f10203d70b37b14;p=clang Fix some handling of AST nodes with diagnostics. The diagnostic system for Clang can already handle many AST nodes. Instead of converting them to strings first, just hand the AST node directly to the diagnostic system and let it handle the output. Minor changes in some diagnostic output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328688 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index e91a787206..cc4232fc4f 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -575,7 +575,7 @@ def err_cxx11_attribute_forbids_arguments : Error< def err_attribute_requires_arguments : Error< "parentheses must be omitted if %0 attribute's argument list is empty">; def err_cxx11_attribute_forbids_ellipsis : Error< - "attribute '%0' cannot be used as an attribute pack">; + "attribute %0 cannot be used as an attribute pack">; def err_cxx11_attribute_repeated : Error< "attribute %0 cannot appear multiple times in an attribute specifier">; def warn_cxx14_compat_using_attribute_ns : Warning< diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index a353928991..06ae1b7a2a 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1329,7 +1329,7 @@ def err_invalid_member_in_interface : Error< "nested class }0%1 is not permitted within an interface type">; def err_invalid_base_in_interface : Error< "interface type cannot inherit from " - "%select{'struct|non-public 'interface|'class}0 %1'">; + "%select{struct|non-public interface|class}0 %1">; def err_abstract_type_in_decl : Error< "%select{return|parameter|variable|field|instance variable|" @@ -1629,7 +1629,7 @@ def err_missing_default_ctor : Error< "%select{base class|member}2 %3 %select{which|which|of %1}0 " "does not have a default constructor">; def note_due_to_dllexported_class : Note< - "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">; + "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">; def err_illegal_union_or_anon_struct_member : Error< "%select{anonymous struct|union}0 member %1 has a non-trivial " @@ -2986,11 +2986,11 @@ def warn_lock_exclusive_and_shared : Warning< def note_lock_exclusive_and_shared : Note< "the other acquisition of %0 '%1' is here">; def warn_variable_requires_any_lock : Warning< - "%select{reading|writing}1 variable '%0' requires holding " + "%select{reading|writing}1 variable %0 requires holding " "%select{any mutex|any mutex exclusively}1">, InGroup, DefaultIgnore; def warn_var_deref_requires_any_lock : Warning< - "%select{reading|writing}1 the value pointed to by '%0' requires holding " + "%select{reading|writing}1 the value pointed to by %0 requires holding " "%select{any mutex|any mutex exclusively}1">, InGroup, DefaultIgnore; def warn_fun_excludes_mutex : Warning< @@ -3014,25 +3014,25 @@ def warn_acquire_requires_negative_cap : Warning< // Thread safety warnings on pass by reference def warn_guarded_pass_by_reference : Warning< - "passing variable '%1' by reference requires holding %0 " + "passing variable %1 by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; def warn_pt_guarded_pass_by_reference : Warning< - "passing the value that '%1' points to by reference requires holding %0 " + "passing the value that %1 points to by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; // Imprecise thread safety warnings def warn_variable_requires_lock : Warning< - "%select{reading|writing}3 variable '%1' requires holding %0 " + "%select{reading|writing}3 variable %1 requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; def warn_var_deref_requires_lock : Warning< - "%select{reading|writing}3 the value pointed to by '%1' requires " + "%select{reading|writing}3 the value pointed to by %1 requires " "holding %0 %select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; def warn_fun_requires_lock : Warning< - "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">, + "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; // Precise thread safety warnings @@ -3050,7 +3050,7 @@ def note_found_mutex_near_match : Note<"found near match '%0'">; // Verbose thread safety warnings def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, InGroup, DefaultIgnore; -def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">; +def note_thread_warning_in_fun : Note<"Thread warning in function %0">; def note_guarded_by_declared_here : Note<"Guarded_by declared here.">; // Dummy warning that will trigger "beta" warnings from the analysis if enabled. @@ -6186,9 +6186,9 @@ def err_objc_object_catch : Error< def err_incomplete_type_objc_at_encode : Error< "'@encode' of incomplete type %0">; def warn_objc_circular_container : Warning< - "adding '%0' to '%1' might cause circular dependency in container">, + "adding %0 to %1 might cause circular dependency in container">, InGroup>; -def note_objc_circular_container_declared_here : Note<"'%0' declared here">; +def note_objc_circular_container_declared_here : Note<"%0 declared here">; def warn_objc_unsafe_perform_selector : Warning< "%0 is incompatible with selectors that return a " "%select{struct|union|vector}1 type">, @@ -7137,7 +7137,7 @@ def err_va_arg_in_device : Error< "CUDA device code does not support va_arg">; def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; def err_cuda_unattributed_constexpr_cannot_overload_device : Error< - "constexpr function '%0' without __host__ or __device__ attributes cannot " + "constexpr function %0 without __host__ or __device__ attributes cannot " "overload __device__ function with same signature. Add a __host__ " "attribute, or build with -fno-cuda-host-device-constexpr.">; def note_cuda_conflicting_device_function_declared_here : Note< @@ -9336,7 +9336,8 @@ def ext_warn_gnu_final : ExtWarn< InGroup; def warn_shadow_field : - Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">, + Warning<"non-static data member %0 of %1 shadows member inherited from " + "type %2">, InGroup, DefaultIgnore; def note_shadow_field : Note<"declared here">; diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 6ab737d15c..8814b23d3f 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1344,7 +1344,7 @@ static bool EvaluateHasIncludeCommon(Token &Tok, // These expressions are only allowed within a preprocessor directive. if (!PP.isParsingIfOrElifDirective()) { - PP.Diag(LParenLoc, diag::err_pp_directive_required) << II->getName(); + PP.Diag(LParenLoc, diag::err_pp_directive_required) << II; // Return a valid identifier token. assert(Tok.is(tok::identifier)); Tok.setIdentifierInfo(II); diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 207047b03c..0c789c9b1c 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -4036,7 +4036,7 @@ void Parser::ParseCXX11AttributeSpecifier(ParsedAttributes &attrs, if (TryConsumeToken(tok::ellipsis)) Diag(Tok, diag::err_cxx11_attribute_forbids_ellipsis) - << AttrName->getName(); + << AttrName; } if (ExpectAndConsume(tok::r_square)) diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 8397a1f936..2903f5399a 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -1601,7 +1601,7 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { if (Verbose && CurrentFunction) { PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(), S.PDiag(diag::note_thread_warning_in_fun) - << CurrentFunction->getNameAsString()); + << CurrentFunction); return OptionalNotes(1, FNote); } return OptionalNotes(); @@ -1612,7 +1612,7 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { if (Verbose && CurrentFunction) { PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(), S.PDiag(diag::note_thread_warning_in_fun) - << CurrentFunction->getNameAsString()); + << CurrentFunction); ONS.push_back(std::move(FNote)); } return ONS; @@ -1626,7 +1626,7 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { if (Verbose && CurrentFunction) { PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(), S.PDiag(diag::note_thread_warning_in_fun) - << CurrentFunction->getNameAsString()); + << CurrentFunction); ONS.push_back(std::move(FNote)); } return ONS; @@ -1742,7 +1742,7 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { diag::warn_variable_requires_any_lock: diag::warn_var_deref_requires_any_lock; PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID) - << D->getNameAsString() << getLockKindFromAccessKind(AK)); + << D << getLockKindFromAccessKind(AK)); Warnings.emplace_back(std::move(Warning), getNotes()); } @@ -1770,7 +1770,7 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { break; } PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID) << Kind - << D->getNameAsString() + << D << LockName << LK); PartialDiagnosticAt Note(Loc, S.PDiag(diag::note_found_mutex_near_match) << *PossibleMatch); @@ -1800,12 +1800,11 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { break; } PartialDiagnosticAt Warning(Loc, S.PDiag(DiagID) << Kind - << D->getNameAsString() + << D << LockName << LK); if (Verbose && POK == POK_VarAccess) { PartialDiagnosticAt Note(D->getLocation(), - S.PDiag(diag::note_guarded_by_declared_here) - << D->getNameAsString()); + S.PDiag(diag::note_guarded_by_declared_here)); Warnings.emplace_back(std::move(Warning), getNotes(Note)); } else Warnings.emplace_back(std::move(Warning), getNotes()); diff --git a/lib/Sema/SemaCUDA.cpp b/lib/Sema/SemaCUDA.cpp index ccd93fa48b..8224bd85f1 100644 --- a/lib/Sema/SemaCUDA.cpp +++ b/lib/Sema/SemaCUDA.cpp @@ -521,7 +521,7 @@ void Sema::maybeAddCUDAHostDeviceAttrs(FunctionDecl *NewD, if (!getSourceManager().isInSystemHeader(Match->getLocation())) { Diag(NewD->getLocation(), diag::err_cuda_unattributed_constexpr_cannot_overload_device) - << NewD->getName(); + << NewD; Diag(Match->getLocation(), diag::note_cuda_conflicting_device_function_declared_here); } diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 80ea1379d4..2efdcd36a6 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -11521,7 +11521,7 @@ void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) { if (ArgRE->isObjCSelfExpr()) { Diag(Message->getSourceRange().getBegin(), diag::warn_objc_circular_container) - << ArgRE->getDecl()->getName() << StringRef("super"); + << ArgRE->getDecl() << StringRef("'super'"); } } } else { @@ -11537,11 +11537,11 @@ void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) { ValueDecl *Decl = ReceiverRE->getDecl(); Diag(Message->getSourceRange().getBegin(), diag::warn_objc_circular_container) - << Decl->getName() << Decl->getName(); + << Decl << Decl; if (!ArgRE->isObjCSelfExpr()) { Diag(Decl->getLocation(), diag::note_objc_circular_container_declared_here) - << Decl->getName(); + << Decl; } } } @@ -11551,10 +11551,10 @@ void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) { ObjCIvarDecl *Decl = IvarRE->getDecl(); Diag(Message->getSourceRange().getBegin(), diag::warn_objc_circular_container) - << Decl->getName() << Decl->getName(); + << Decl << Decl; Diag(Decl->getLocation(), diag::note_objc_circular_container_declared_here) - << Decl->getName(); + << Decl; } } } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 68ad1cd78f..bc3e42739d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -10336,7 +10336,7 @@ namespace { S.DiagRuntimeBehavior(DRE->getLocStart(), DRE, S.PDiag(diag) - << DRE->getNameInfo().getName() + << DRE->getDecl() << OrigDecl->getLocation() << DRE->getSourceRange()); } @@ -16147,7 +16147,7 @@ static void CheckForDuplicateEnumValues(Sema &S, ArrayRef Elements, // Emit warning for one enum constant. ECDVector::iterator I = Vec->begin(); S.Diag((*I)->getLocation(), diag::warn_duplicate_enum_values) - << (*I)->getName() << (*I)->getInitVal().toString(10) + << (*I) << (*I)->getInitVal().toString(10) << (*I)->getSourceRange(); ++I; @@ -16155,7 +16155,7 @@ static void CheckForDuplicateEnumValues(Sema &S, ArrayRef Elements, // the same value. for (ECDVector::iterator E = Vec->end(); I != E; ++I) S.Diag((*I)->getLocation(), diag::note_duplicate_element) - << (*I)->getName() << (*I)->getInitVal().toString(10) + << (*I) << (*I)->getInitVal().toString(10) << (*I)->getSourceRange(); delete Vec; } diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 6160eccabe..a56869f623 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2404,7 +2404,7 @@ bool Sema::AttachBaseSpecifiers(CXXRecordDecl *Class, // The Microsoft extension __interface does not permit bases that // are not themselves public interfaces. Diag(KnownBase->getLocStart(), diag::err_invalid_base_in_interface) - << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getName() + << getRecordDiagFromTagKind(RD->getTagKind()) << RD << RD->getSourceRange(); Invalid = true; } @@ -2862,7 +2862,7 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc, if (AS_none != CXXRecordDecl::MergeAccess(P.Access, BaseField->getAccess())) { Diag(Loc, diag::warn_shadow_field) - << FieldName.getAsString() << RD->getName() << Base->getName(); + << FieldName << RD << Base; Diag(BaseField->getLocation(), diag::note_shadow_field); Bases.erase(It); } @@ -5528,7 +5528,7 @@ static void ReferenceDllExportedMembers(Sema &S, CXXRecordDecl *Class) { S.MarkFunctionReferenced(Class->getLocation(), MD); if (Trap.hasErrorOccurred()) { S.Diag(ClassAttr->getLocation(), diag::note_due_to_dllexported_class) - << Class->getName() << !S.getLangOpts().CPlusPlus11; + << Class << !S.getLangOpts().CPlusPlus11; break; } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 07eb02bec0..c0533f7cc7 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5511,7 +5511,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, // CUDA: Kernel calls must be to global functions if (FDecl && !FDecl->hasAttr()) return ExprError(Diag(LParenLoc,diag::err_kern_call_not_global_function) - << FDecl->getName() << Fn->getSourceRange()); + << FDecl << Fn->getSourceRange()); // CUDA: Kernel function must have 'void' return type if (!FuncT->getReturnType()->isVoidType()) @@ -5521,7 +5521,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, // CUDA: Calls to global functions must be configured if (FDecl && FDecl->hasAttr()) return ExprError(Diag(LParenLoc, diag::err_global_call_not_config) - << FDecl->getName() << Fn->getSourceRange()); + << FDecl << Fn->getSourceRange()); } } @@ -8030,7 +8030,7 @@ Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &CallerRHS, if (Diagnose && isa(PRE)) { ObjCProtocolDecl *PDecl = cast(PRE)->getProtocol(); if (PDecl && !PDecl->hasDefinition()) { - Diag(PRE->getExprLoc(), diag::warn_atprotocol_protocol) << PDecl->getName(); + Diag(PRE->getExprLoc(), diag::warn_atprotocol_protocol) << PDecl; Diag(PDecl->getLocation(), diag::note_entity_declared_at) << PDecl; } } @@ -13516,7 +13516,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, if (DiagKind == diag::warn_incompatible_qualified_id && PDecl && IFace && !IFace->hasDefinition()) Diag(IFace->getLocation(), diag::note_incomplete_class_and_qualified_id) - << IFace->getName() << PDecl->getName(); + << IFace << PDecl; if (SecondType == Context.OverloadTy) NoteAllOverloadCandidates(OverloadExpr::find(SrcExpr).Expression, diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 7d52394bd7..4119e7a4ab 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -10388,7 +10388,7 @@ bool TreeTransform::TransformOverloadExprDecls(OverloadExpr *Old, // the corresponding pack is empty if (AllEmptyPacks && !RequiresADL) { getSema().Diag(Old->getNameLoc(), diag::err_using_pack_expansion_empty) - << isa(Old) << Old->getNameInfo().getName(); + << isa(Old) << Old->getName(); return true; } diff --git a/test/Preprocessor/has_include.c b/test/Preprocessor/has_include.c index ad7329390e..af1f6b8414 100644 --- a/test/Preprocessor/has_include.c +++ b/test/Preprocessor/has_include.c @@ -93,19 +93,19 @@ // Try as non-preprocessor directives void foo( void ) { - __has_include_next("stdint.h") // expected-warning {{#include_next in primary source file}} expected-error {{__has_include_next must be used within a preprocessing directive}} - __has_include("stdint.h") // expected-error {{__has_include must be used within a preprocessing directive}} + __has_include_next("stdint.h") // expected-warning {{#include_next in primary source file}} expected-error {{'__has_include_next' must be used within a preprocessing directive}} + __has_include("stdint.h") // expected-error {{'__has_include' must be used within a preprocessing directive}} } -MACRO1 // expected-error {{__has_include must be used within a preprocessing directive}} +MACRO1 // expected-error {{'__has_include' must be used within a preprocessing directive}} #if 1 -MACRO1 // expected-error {{__has_include must be used within a preprocessing directive}} +MACRO1 // expected-error {{'__has_include' must be used within a preprocessing directive}} #endif #if 0 #elif 1 -MACRO1 // expected-error {{__has_include must be used within a preprocessing directive}} +MACRO1 // expected-error {{'__has_include' must be used within a preprocessing directive}} #endif #if 0 @@ -148,7 +148,7 @@ MACRO1 // This should be fine because it is never actually reached #if __has_include(stdint.h>) #endif -// expected-error@+1 {{__has_include must be used within a preprocessing directive}} +// expected-error@+1 {{'__has_include' must be used within a preprocessing directive}} __has_include // expected-error@+1 {{missing ')' after '__has_include'}} // expected-error@+1 {{expected value in expression}} // expected-note@+1 {{to match this '('}} diff --git a/test/Sema/warn-duplicate-enum.c b/test/Sema/warn-duplicate-enum.c index f108b3aa6c..84fdeb4f8f 100644 --- a/test/Sema/warn-duplicate-enum.c +++ b/test/Sema/warn-duplicate-enum.c @@ -1,29 +1,29 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify -Wduplicate-enum // RUN: %clang_cc1 %s -x c++ -fsyntax-only -verify -Wduplicate-enum enum A { - A1 = 0, // expected-note {{element A1 also has value 0}} + A1 = 0, // expected-note {{element 'A1' also has value 0}} A2 = -1, - A3, // expected-warning {{element A3 has been implicitly assigned 0 which another element has been assigned}} + A3, // expected-warning {{element 'A3' has been implicitly assigned 0 which another element has been assigned}} A4}; enum B { - B1 = -1, // expected-note {{element B1 also has value -1}} - B2, // expected-warning {{element B2 has been implicitly assigned 0 which another element has been assigned}} + B1 = -1, // expected-note {{element 'B1' also has value -1}} + B2, // expected-warning {{element 'B2' has been implicitly assigned 0 which another element has been assigned}} B3, B4 = -2, - B5, // expected-warning {{element B5 has been implicitly assigned -1 which another element has been assigned}} - B6 // expected-note {{element B6 also has value 0}} + B5, // expected-warning {{element 'B5' has been implicitly assigned -1 which another element has been assigned}} + B6 // expected-note {{element 'B6' also has value 0}} }; -enum C { C1, C2 = -1, C3 }; // expected-warning{{element C1 has been implicitly assigned 0 which another element has been assigned}} \ - // expected-note {{element C3 also has value 0}} +enum C { C1, C2 = -1, C3 }; // expected-warning{{element 'C1' has been implicitly assigned 0 which another element has been assigned}} \ + // expected-note {{element 'C3' also has value 0}} enum D { D1, D2, - D3, // expected-warning{{element D3 has been implicitly assigned 2 which another element has been assigned}} + D3, // expected-warning{{element 'D3' has been implicitly assigned 2 which another element has been assigned}} D4 = D2, // no warning - D5 = 2 // expected-note {{element D5 also has value 2}} + D5 = 2 // expected-note {{element 'D5' also has value 2}} }; enum E { diff --git a/test/SemaCUDA/function-overload.cu b/test/SemaCUDA/function-overload.cu index adf488b5ee..1d78636a70 100644 --- a/test/SemaCUDA/function-overload.cu +++ b/test/SemaCUDA/function-overload.cu @@ -119,7 +119,7 @@ __host__ void hostf() { HostReturnTy ret_cdh = cdh(); GlobalFnPtr fp_g = g; - g(); // expected-error {{call to global function g not configured}} + g(); // expected-error {{call to global function 'g' not configured}} g<<<0, 0>>>(); } @@ -202,7 +202,7 @@ __host__ __device__ void hostdevicef() { #if defined (__CUDA_ARCH__) // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}} #else - // expected-error@-4 {{call to global function g not configured}} + // expected-error@-4 {{call to global function 'g' not configured}} #endif g<<<0,0>>>(); diff --git a/test/SemaCUDA/kernel-call.cu b/test/SemaCUDA/kernel-call.cu index 47d7762f59..b2433c956e 100644 --- a/test/SemaCUDA/kernel-call.cu +++ b/test/SemaCUDA/kernel-call.cu @@ -13,13 +13,13 @@ int h2(int x) { return 1; } int main(void) { g1<<<1, 1>>>(42); - g1(42); // expected-error {{call to global function g1 not configured}} + g1(42); // expected-error {{call to global function 'g1' not configured}} g1<<<1>>>(42); // expected-error {{too few execution configuration arguments to kernel function call}} g1<<<1, 1, 0, 0, 0>>>(42); // expected-error {{too many execution configuration arguments to kernel function call}} t1(1); - h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}} + h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function 'h1'}} int (*fp)(int) = h2; fp<<<1, 1>>>(42); // expected-error {{must have void return type}} diff --git a/test/SemaCXX/ms-interface.cpp b/test/SemaCXX/ms-interface.cpp index 66ce376e2a..c827f4c570 100644 --- a/test/SemaCXX/ms-interface.cpp +++ b/test/SemaCXX/ms-interface.cpp @@ -47,7 +47,7 @@ __interface I4 : I1, I2 { void fn2() final; }; -// expected-error@+1 {{interface type cannot inherit from non-public 'interface I1'}} +// expected-error@+1 {{interface type cannot inherit from non-public interface 'I1'}} __interface I5 : private I1 { }; @@ -65,12 +65,12 @@ static_assert(!__is_interface_class(C), "oops"); static_assert(!__is_interface_class(I), "oops"); static_assert(!__is_interface_class(U), "oops"); -// expected-error@55 {{interface type cannot inherit from 'struct S'}} +// expected-error@55 {{interface type cannot inherit from struct 'S'}} // expected-note@+1 {{in instantiation of template class 'I6' requested here}} struct S1 : I6 { }; -// expected-error@55 {{interface type cannot inherit from 'class C'}} +// expected-error@55 {{interface type cannot inherit from class 'C'}} // expected-note@+1 {{in instantiation of template class 'I6' requested here}} class C1 : I6 { }; diff --git a/test/SemaCXX/typo-correction.cpp b/test/SemaCXX/typo-correction.cpp index 2d78f06c5d..ed845c3e83 100644 --- a/test/SemaCXX/typo-correction.cpp +++ b/test/SemaCXX/typo-correction.cpp @@ -647,7 +647,7 @@ namespace testArraySubscriptIndex { namespace crash_has_include { int has_include(int); // expected-note {{'has_include' declared here}} -// expected-error@+1 {{__has_include must be used within a preprocessing directive}} +// expected-error@+1 {{'__has_include' must be used within a preprocessing directive}} int foo = __has_include(42); // expected-error {{use of undeclared identifier '__has_include'; did you mean 'has_include'?}} } diff --git a/test/SemaCXX/warn-thread-safety-analysis.cpp b/test/SemaCXX/warn-thread-safety-analysis.cpp index 829e2e4916..db1373d5a1 100644 --- a/test/SemaCXX/warn-thread-safety-analysis.cpp +++ b/test/SemaCXX/warn-thread-safety-analysis.cpp @@ -1933,7 +1933,7 @@ void test() { f1.mu_.Unlock(); bt.barTD(&f1); // \ - // expected-warning {{calling function 'barTD' requires holding mutex 'f1.mu_' exclusively}} \ + // expected-warning {{calling function 'barTD' requires holding mutex 'f1.mu_' exclusively}} \ // expected-note {{found near match 'bt.fooBase.mu_'}} bt.fooBase.mu_.Unlock(); @@ -2130,10 +2130,10 @@ void test() { myFoo.foo3(&myFoo); // \ // expected-warning {{calling function 'foo3' requires holding mutex 'myFoo.mu_' exclusively}} myFoo.fooT1(dummy); // \ - // expected-warning {{calling function 'fooT1' requires holding mutex 'myFoo.mu_' exclusively}} + // expected-warning {{calling function 'fooT1' requires holding mutex 'myFoo.mu_' exclusively}} myFoo.fooT2(dummy); // \ - // expected-warning {{calling function 'fooT2' requires holding mutex 'myFoo.mu_' exclusively}} + // expected-warning {{calling function 'fooT2' requires holding mutex 'myFoo.mu_' exclusively}} fooF1(&myFoo); // \ // expected-warning {{calling function 'fooF1' requires holding mutex 'myFoo.mu_' exclusively}} @@ -3565,7 +3565,7 @@ void Foo::elr(Cell* c1) { } void Foo::test() { Cell cell; elr(&cell); // \ - // expected-warning {{calling function 'elr' requires holding mutex 'cell.mu_' exclusively}} + // expected-warning {{calling function 'elr' requires holding mutex 'cell.mu_' exclusively}} } @@ -3578,7 +3578,7 @@ void globalELR(Cell* c1) { } void globalTest() { Cell cell; globalELR(&cell); // \ - // expected-warning {{calling function 'globalELR' requires holding mutex 'cell.mu_' exclusively}} + // expected-warning {{calling function 'globalELR' requires holding mutex 'cell.mu_' exclusively}} } @@ -3599,7 +3599,7 @@ void globalELR2(Cell* c4); void globalTest2() { Cell cell; globalELR2(&cell); // \ - // expected-warning {{calling function 'globalELR2' requires holding mutex 'cell.mu_' exclusively}} + // expected-warning {{calling function 'globalELR2' requires holding mutex 'cell.mu_' exclusively}} } diff --git a/test/SemaObjC/comptypes-legal.m b/test/SemaObjC/comptypes-legal.m index 05f18977cc..7ac4e14333 100644 --- a/test/SemaObjC/comptypes-legal.m +++ b/test/SemaObjC/comptypes-legal.m @@ -42,7 +42,7 @@ void foo(void) - (void) Meth : (id )aKey; // expected-note {{passing argument to parameter 'aKey' here}} @end -@class ForwarClass; // expected-note 3 {{conformance of forward class ForwarClass to protocol NSCopying can not be confirmed}} +@class ForwarClass; // expected-note 3 {{conformance of forward class 'ForwarClass' to protocol 'NSCopying' can not be confirmed}} ForwarClass *Test10751015 (I* pi, ForwarClass *ns_forward) { diff --git a/test/SemaObjC/protocol-expr-neg-1.m b/test/SemaObjC/protocol-expr-neg-1.m index aed56c016b..26cdac70ae 100644 --- a/test/SemaObjC/protocol-expr-neg-1.m +++ b/test/SemaObjC/protocol-expr-neg-1.m @@ -12,7 +12,7 @@ int main() { Protocol *proto = @protocol(p1); - Protocol *fproto = @protocol(fproto); // expected-warning {{@protocol is using a forward protocol declaration of fproto}} + Protocol *fproto = @protocol(fproto); // expected-warning {{@protocol is using a forward protocol declaration of 'fproto'}} Protocol *pp = @protocol(i); // expected-error {{cannot find protocol declaration for 'i'}} Protocol *p1p = @protocol(cl); // expected-error {{cannot find protocol declaration for 'cl'}} } @@ -26,9 +26,9 @@ int main() @end int doesConform(id foo) { - return [foo conformsToProtocol:@protocol(TestProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of TestProtocol}} + return [foo conformsToProtocol:@protocol(TestProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of 'TestProtocol'}} } int doesConformSuper(id foo) { - return [foo conformsToProtocol:@protocol(SuperProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of SuperProtocol}} + return [foo conformsToProtocol:@protocol(SuperProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of 'SuperProtocol'}} } diff --git a/test/SemaTemplate/warn-thread-safety-analysis.cpp b/test/SemaTemplate/warn-thread-safety-analysis.cpp index 03bae7a292..710f424c17 100644 --- a/test/SemaTemplate/warn-thread-safety-analysis.cpp +++ b/test/SemaTemplate/warn-thread-safety-analysis.cpp @@ -23,8 +23,8 @@ void f() { a.mu2.Lock(); a.bar(); a.mu2.Unlock(); - a.bar(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}} + a.bar(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}} a.mu1.Unlock(); - a.bar(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu1' exclusively}} \ - expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}} + a.bar(); // expected-warning {{calling function 'bar' requires holding mutex 'a.mu1' exclusively}} \ + expected-warning {{calling function 'bar' requires holding mutex 'a.mu2' exclusively}} }