summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/implicit-decl.c
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2017-08-10 15:43:06 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2017-08-10 15:43:06 +0000
commit57c681f33e56019ab92901e09d7bd26b0ccdffa5 (patch)
treed04a2d4992b1b8f97d8ac8aa0f7e07df124e5257 /clang/test/Sema/implicit-decl.c
parentc717041e847db8bd7dfee61ee2a00c3653704651 (diff)
downloadbcm5719-llvm-57c681f33e56019ab92901e09d7bd26b0ccdffa5.tar.gz
bcm5719-llvm-57c681f33e56019ab92901e09d7bd26b0ccdffa5.zip
Place implictly declared functions at block scope
Such implicitly declared functions behave as if the enclosing block contained the declaration extern int name() (C90, 6.3.3.2 Function calls), thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers). This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224 Differential Revision: https://reviews.llvm.org/D33676 llvm-svn: 310616
Diffstat (limited to 'clang/test/Sema/implicit-decl.c')
-rw-r--r--clang/test/Sema/implicit-decl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/Sema/implicit-decl.c b/clang/test/Sema/implicit-decl.c
index ffab9a6f913..0a892010783 100644
--- a/clang/test/Sema/implicit-decl.c
+++ b/clang/test/Sema/implicit-decl.c
@@ -9,8 +9,7 @@ void func() {
int32_t *vector[16];
const char compDesc[16 + 1];
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}}
}
printg("Hello, World!\n"); // expected-error{{implicit declaration of function 'printg' is invalid in C99}} \
@@ -18,7 +17,7 @@ void func() {
__builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}}
}
-Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error{{conflicting types for '_CFCalendarDecomposeAbsoluteTimeV'}}
+Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) {
return 0;
}
OpenPOWER on IntegriCloud