[PATCH] Add new diagnostic to check for bad member function calls in mem-initializer-lists.

Emily Bellows emily.a.bellows at gmail.com
Sat Dec 6 04:14:43 PST 2014


Hi rsmith,

Hi,

This patch adds a new diagnostic that checks for member function calls before all base classes in a mem-initializer-list are initialized, which is undefined behavior. (C++03 12.6.2p8; C++11 12.6.2p13.)

The added code looks for member call expressions which use implicit or explicit 'this' inside of the arguments of a base class initializer to signal the warning.

http://reviews.llvm.org/D6561

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaDeclCXX.cpp
  test/SemaCXX/member-call-before-bases-init.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6561.17020.patch
Type: text/x-patch
Size: 3439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141206/64eb82c7/attachment.bin>


More information about the cfe-commits mailing list