https://llvm.org/bugs/show_bug.cgi?id=25350
Bug ID: 25350 Summary: Warn about overload resolution with forward-declared types? Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: enhancement Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: h...@chromium.org CC: llvm-bugs@lists.llvm.org, nicolaswe...@gmx.de Classification: Unclassified Consider the following: s.h: struct S {}; struct T : S {}; a.cc: #if X // Forward declarations, for speed: struct S; struct T; #else // Just include it, for clarity: #include "s.h" #endif void f(void*); void f(S*); void surprise(T *t) { f(t); } // Which f gets called? Depending on the value of X, i.e. whether we're including s.h or forward declaring S and T, the call in surprise() will be bound to a different function. Could we warn that overload resolution for the call to f is based on an incomplete type? (Inspired by an example from: http://google.github.io/styleguide/cppguide.html#Forward_Declarations) -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs