summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2018-03-01 07:04:11 +0000
committerSerge Pavlov <sepavloff@gmail.com>2018-03-01 07:04:11 +0000
commite6e534ca22fb38ca06b92d87c7847920f5bf3fe9 (patch)
tree5994c770aa7f3bbd2fcacea78881578034b0b4ea /lldb/packages/Python/lldbsuite/test/lang/cpp
parentf8d2969abbe88da15b809c03854d5f9a6b5aaa8d (diff)
downloadbcm5719-llvm-e6e534ca22fb38ca06b92d87c7847920f5bf3fe9.tar.gz
bcm5719-llvm-e6e534ca22fb38ca06b92d87c7847920f5bf3fe9.zip
Function definition may have uninstantiated body
Current implementation of `FunctionDecl::isDefined` does not take into account redeclarations that do not have bodies, but the bodies can be instantiated from corresponding templated definition. This behavior does not allow to detect function redefinition in the cases where friend functions is defined in class templates. For instance, the code: ``` template<typename T> struct X { friend void f() {} }; X<int> xi; void f() {} ``` compiles successfully but must fail due to redefinition of `f`. The declaration of the friend `f` is created when the containing template `X` is instantiated, but it does not have a body as per 14.5.4p4 because `f` is not odr-used. With this change the function `Sema::CheckForFunctionRedefinition` considers functions with uninstantiated bodies as definitions. Differential Revision: https://reviews.llvm.org/D30170 llvm-svn: 326419
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud