Skip to content

Commit 85ee1d3

Browse files
committed
Revert "Disable -Wmissing-prototypes for internal linkage functions that aren't explicitly marked "static""
Regresses: typedef struct { static void f() { } } a_t; Causing this to error instead of warn, because the linkage is computed earlier/too early perhaps. I'll send out a review to see if there's some other path forward or if this is an acceptable regression, etc. This reverts commit 275c562.
1 parent f2a9753 commit 85ee1d3

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14210,9 +14210,6 @@ ShouldWarnAboutMissingPrototype(const FunctionDecl *FD,
1421014210
if (!FD->isGlobal())
1421114211
return false;
1421214212

14213-
if (!FD->isExternallyVisible())
14214-
return false;
14215-
1421614213
// Don't warn about C++ member functions.
1421714214
if (isa<CXXMethodDecl>(FD))
1421814215
return false;

clang/test/SemaCXX/warn-missing-prototypes.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,3 @@ void j() = delete;
4444
extern void k() {} // expected-warning {{no previous prototype for function 'k'}}
4545
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
4646
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:{{.*}}-[[@LINE-2]]:{{.*}}}:"{{.*}}"
47-
48-
namespace {
49-
struct anon { };
50-
}
51-
52-
// No warning because this has internal linkage despite not being declared
53-
// explicitly 'static', owing to the internal linkage parameter.
54-
void l(anon) {
55-
}
56-
57-
void *operator new(decltype(sizeof(3)) size, const anon &) throw() {
58-
return nullptr;
59-
}

0 commit comments

Comments
 (0)