[PATCH] D19312: Warn about UB at member function calls from base class ctor initializers.
Raphael Isemann via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 20 02:00:31 PDT 2016
teemperor created this revision.
teemperor added a reviewer: rsmith.
teemperor added a subscriber: cfe-commits.
According to [12.6.2 p16] calling member functions of the current
class before all the base classes are initialized is undefined behavior.
Some compilers (such as GCC 5.3 + ubsan) can produce a segfaulting code
in the program when such code is encountered (see GCC bug #70035),
so clang should generate a warning about the UB.
http://reviews.llvm.org/D19312
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/ctor-init-with-member-call.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19312.54330.patch
Type: text/x-patch
Size: 5347 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160420/b270cb2a/attachment.bin>
More information about the cfe-commits
mailing list