[PATCH] D33676: Place implictly declared functions at block scope

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 01:03:42 PDT 2017


rogfer01 added a comment.

Given that we are already considering extensions, maybe you want to add a test for compound statements in expressions.

  void foo(void)
  {
    ({ bar(); });
    int (*p)() = bar; /* expected-error {{use of undeclared identifier 'bar'}} */
  }

This already works with your patch: just to make clear how we interact with it.



================
Comment at: test/Sema/implicit-decl.c:12
    int32_t compCount = 0;
-   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}} \
-         expected-error {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}}
+   if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}}
    }
----------------
Is there a way not to lose the note?


https://reviews.llvm.org/D33676





More information about the cfe-commits mailing list