diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-06-13 06:43:46 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-13 06:43:46 +0000 |
commit | 22b4e77bd6ac8b36a61fb1cf830c3af191950d4c (patch) | |
tree | bc5d5ff0f3b7a4da5093bbb836782d6fc61be9f1 /include | |
parent | af74764a820bdf7d017a8c934bc7140cb080d9e1 (diff) | |
download | clang-22b4e77bd6ac8b36a61fb1cf830c3af191950d4c.tar.gz clang-22b4e77bd6ac8b36a61fb1cf830c3af191950d4c.tar.bz2 clang-22b4e77bd6ac8b36a61fb1cf830c3af191950d4c.tar.xz |
MS ABI: Fix inheritance model calculation in CRTP
CRTP-like patterns involve a class which inherits from another class
using itself as a template parameter.
However, the base class itself may try to create a pointer-to-member
which involves the derived class. This is problematic because we
may not have finished parsing the most derived classes' base specifiers
yet.
It turns out that MSVC simply uses the unspecified inheritance model
instead of doing anything fancy.
This fixes PR19987.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 56bbbb1691..72fad7c28e 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -462,6 +462,9 @@ class CXXRecordDecl : public RecordDecl { /// \brief Whether this class describes a C++ lambda. bool IsLambda : 1; + /// \brief Whether we are currently parsing base specifiers. + bool IsParsingBaseSpecifiers : 1; + /// \brief The number of base class specifiers in Bases. unsigned NumBases; @@ -685,6 +688,12 @@ public: return data().Polymorphic || data().NumVBases != 0; } + void setIsParsingBaseSpecifiers() { data().IsParsingBaseSpecifiers = true; } + + bool isParsingBaseSpecifiers() const { + return data().IsParsingBaseSpecifiers; + } + /// \brief Sets the base classes of this struct or class. void setBases(CXXBaseSpecifier const * const *Bases, unsigned NumBases); |