[LLVMbugs] [Bug 10004] New: [QoI] warn about non-static, non-inline, non-template function definitions in header files

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 24 08:00:27 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10004

           Summary: [QoI] warn about non-static, non-inline, non-template
                    function definitions in header files
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu


clang -Wall -Wextra produces no warnings for this:

// a.h
struct S {
  void f();
};

void S::f() {}

// a.cpp
#include "a.h"
void g() {
  S s;
  s.f();
}

This issue is a particular efficiency drain since it doesn't manifest until
link time, and requires a rebuild of all includers of the header.

Ideally, any definition which wholly comes from a header file and produces a
non-weak symbol should warn. We'll need to be careful to weed out macros
defined in the main source file and expanded in #included files.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list