[PATCH] Diagnose the usage of an MS inline assembly label not defined in the same assembly block

Reid Kleckner rnk at google.com
Tue Oct 14 16:58:48 PDT 2014


================
Comment at: test/Sema/ms-inline-asm.c:109
@@ -108,3 +108,3 @@
 __declspec(naked) int t5(int x) { // expected-note {{attribute is here}}
-  asm { movl eax, x } // expected-error {{parameter references not allowed in naked functions}} expected-error {{use of undeclared label 'x'}}
+  asm { movl eax, x } // expected-error {{parameter references not allowed in naked functions}} expected-error {{use of undeclared label 'x'}} expected-error {{cannot use inline assembly label 'x' defined outside of an inline assembly block}}
   asm { retl }
----------------
ehsan wrote:
> rnk wrote:
> > Hm, this diagnostic is pretty bad. :( We should try returning the found declaration even when we generate the first diagnostic to suppress these follow on diagnostics.
> Can I do that in a separate patch?  It's only tangentially related to this change.
Yeah.

http://reviews.llvm.org/D5694






More information about the cfe-commits mailing list