Index: include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- include/clang/Basic/DiagnosticSemaKinds.td +++ include/clang/Basic/DiagnosticSemaKinds.td @@ -4266,9 +4266,11 @@ def err_conflicting_types : Error<"conflicting types for %0">; def err_different_pass_object_size_params : Error< "conflicting pass_object_size attributes on parameters">; -def err_late_asm_label_name : Error< - "cannot apply asm label to %select{variable|function}0 after its first use">; -def err_different_asm_label : Error<"conflicting asm label">; +def warn_late_asm_label_name : Warning< + "cannot apply asm label to %select{variable|function}0 after its first use">, + InGroup; +def warn_different_asm_label : Warning<"conflicting asm label">, + InGroup; def err_nested_redefinition : Error<"nested redefinition of %0">; def err_use_with_wrong_tag : Error< "use of %0 with tag type that does not match previous declaration">; Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -2385,13 +2385,13 @@ if (AsmLabelAttr *OldA = Old->getAttr()) { if (OldA->getLabel() != NewA->getLabel()) { // This redeclaration changes __asm__ label. - Diag(New->getLocation(), diag::err_different_asm_label); + Diag(New->getLocation(), diag::warn_different_asm_label); Diag(OldA->getLocation(), diag::note_previous_declaration); } } else if (Old->isUsed()) { // This redeclaration adds an __asm__ label to a declaration that has // already been ODR-used. - Diag(New->getLocation(), diag::err_late_asm_label_name) + Diag(New->getLocation(), diag::warn_late_asm_label_name) << isa(Old) << New->getAttr()->getRange(); } } Index: test/Sema/asm-label.c =================================================================== --- test/Sema/asm-label.c +++ test/Sema/asm-label.c @@ -7,10 +7,10 @@ void f() { g(); } -void g() __asm__("gold"); // expected-error{{cannot apply asm label to function after its first use}} +void g() __asm__("gold"); // expected-warning{{cannot apply asm label to function after its first use}} void h() __asm__("hose"); // expected-note{{previous declaration is here}} -void h() __asm__("hair"); // expected-error{{conflicting asm label}} +void h() __asm__("hair"); // expected-warning{{conflicting asm label}} int x; int x __asm__("xenon"); @@ -18,10 +18,10 @@ int test() { return y; } -int y __asm__("yacht"); // expected-error{{cannot apply asm label to variable after its first use}} +int y __asm__("yacht"); // expected-warning{{cannot apply asm label to variable after its first use}} int z __asm__("zebra"); // expected-note{{previous declaration is here}} -int z __asm__("zooms"); // expected-error{{conflicting asm label}} +int z __asm__("zooms"); // expected-warning{{conflicting asm label}} // No diagnostics on the following.