@@ -738,49 +738,55 @@ void CXXRecordDecl::addedMember(Decl *D) {
738
738
739
739
// Handle constructors.
740
740
if (const auto *Constructor = dyn_cast<CXXConstructorDecl>(D)) {
741
- if (!Constructor->isImplicit ()) {
742
- // Note that we have a user-declared constructor.
743
- data ().UserDeclaredConstructor = true ;
741
+ if (Constructor->isInheritingConstructor ()) {
742
+ // Ignore constructor shadow declarations. They are lazily created and
743
+ // so shouldn't affect any properties of the class.
744
+ } else {
745
+ if (!Constructor->isImplicit ()) {
746
+ // Note that we have a user-declared constructor.
747
+ data ().UserDeclaredConstructor = true ;
748
+
749
+ // C++ [class]p4:
750
+ // A POD-struct is an aggregate class [...]
751
+ // Since the POD bit is meant to be C++03 POD-ness, clear it even if
752
+ // the type is technically an aggregate in C++0x since it wouldn't be
753
+ // in 03.
754
+ data ().PlainOldData = false ;
755
+ }
744
756
745
- // C++ [class]p4:
746
- // A POD-struct is an aggregate class [...]
747
- // Since the POD bit is meant to be C++03 POD-ness, clear it even if the
748
- // type is technically an aggregate in C++0x since it wouldn't be in 03.
749
- data ().PlainOldData = false ;
750
- }
757
+ if (Constructor->isDefaultConstructor ()) {
758
+ SMKind |= SMF_DefaultConstructor;
751
759
752
- if (Constructor->isDefaultConstructor ()) {
753
- SMKind |= SMF_DefaultConstructor;
760
+ if (Constructor->isUserProvided ())
761
+ data ().UserProvidedDefaultConstructor = true ;
762
+ if (Constructor->isConstexpr ())
763
+ data ().HasConstexprDefaultConstructor = true ;
764
+ if (Constructor->isDefaulted ())
765
+ data ().HasDefaultedDefaultConstructor = true ;
766
+ }
754
767
755
- if (Constructor->isUserProvided ())
756
- data ().UserProvidedDefaultConstructor = true ;
757
- if (Constructor->isConstexpr ())
758
- data ().HasConstexprDefaultConstructor = true ;
759
- if (Constructor->isDefaulted ())
760
- data ().HasDefaultedDefaultConstructor = true ;
761
- }
768
+ if (!FunTmpl) {
769
+ unsigned Quals;
770
+ if (Constructor->isCopyConstructor (Quals)) {
771
+ SMKind |= SMF_CopyConstructor;
762
772
763
- if (!FunTmpl) {
764
- unsigned Quals;
765
- if (Constructor->isCopyConstructor (Quals)) {
766
- SMKind |= SMF_CopyConstructor;
773
+ if (Quals & Qualifiers::Const)
774
+ data ().HasDeclaredCopyConstructorWithConstParam = true ;
775
+ } else if (Constructor->isMoveConstructor ())
776
+ SMKind |= SMF_MoveConstructor;
777
+ }
767
778
768
- if (Quals & Qualifiers::Const)
769
- data ().HasDeclaredCopyConstructorWithConstParam = true ;
770
- } else if (Constructor->isMoveConstructor ())
771
- SMKind |= SMF_MoveConstructor;
779
+ // C++11 [dcl.init.aggr]p1: DR1518
780
+ // An aggregate is an array or a class with no user-provided [or]
781
+ // explicit [...] constructors
782
+ // C++20 [dcl.init.aggr]p1:
783
+ // An aggregate is an array or a class with no user-declared [...]
784
+ // constructors
785
+ if (getASTContext ().getLangOpts ().CPlusPlus2a
786
+ ? !Constructor->isImplicit ()
787
+ : (Constructor->isUserProvided () || Constructor->isExplicit ()))
788
+ data ().Aggregate = false ;
772
789
}
773
-
774
- // C++11 [dcl.init.aggr]p1: DR1518
775
- // An aggregate is an array or a class with no user-provided [or]
776
- // explicit [...] constructors
777
- // C++20 [dcl.init.aggr]p1:
778
- // An aggregate is an array or a class with no user-declared [...]
779
- // constructors
780
- if (getASTContext ().getLangOpts ().CPlusPlus2a
781
- ? !Constructor->isImplicit ()
782
- : (Constructor->isUserProvided () || Constructor->isExplicit ()))
783
- data ().Aggregate = false ;
784
790
}
785
791
786
792
// Handle constructors, including those inherited from base classes.
0 commit comments