if (Candidate.WillReplaceSpecifier() && !Candidate.getCorrectionSpecifier())
return false;
+ // FIXME: Don't correct to a name that CheckUsingDeclRedeclaration would
+ // reject.
+
if (RequireMemberOf) {
auto *FoundRecord = dyn_cast<CXXRecordDecl>(ND);
if (FoundRecord && FoundRecord->isInjectedClassName()) {
R.addDecl(Ctor);
} else {
// FIXME: Pick up all the declarations if we found an overloaded function.
+ NameInfo.setName(ND->getDeclName());
R.addDecl(ND);
}
} else {
struct F : E {
using E::EE; // expected-error-re {{no member named 'EE' in 'PR19171::E'{{$}}}}
};
+
+ struct TypoDuplicate { // expected-note 0-4{{here}}
+ TypoDuplicate(int);
+ void foobar(); // expected-note 2{{here}}
+ };
+ struct TypoDuplicateDerived1 : TypoDuplicate {
+#if __cplusplus >= 201103L
+ using TypoDuplicate::TypoFuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-note {{previous}}
+ using TypoDuplicate::TypoDuplicate; // expected-error {{redeclaration}}
+#endif
+ using TypoDuplicate::goobar; // expected-error {{did you mean 'foobar'}} expected-note {{previous}}
+ using TypoDuplicate::foobar; // expected-error {{redeclaration}}
+ };
+ struct TypoDuplicateDerived2 : TypoDuplicate {
+#if __cplusplus >= 201103L
+ using TypoFuplicate::TypoDuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-note {{previous}}
+ using TypoDuplicate::TypoDuplicate; // expected-error {{redeclaration}}
+#endif
+ };
+ struct TypoDuplicateDerived3 : TypoDuplicate {
+#if __cplusplus >= 201103L
+ // FIXME: Don't suggest a correction that would lead to a redeclaration
+ // error here... or at least diagnose the error.
+ using TypoDuplicate::TypoDuplicate;
+ using TypoDuplicate::TypoFuplicate; // expected-error {{did you mean 'TypoDuplicate'}}
+#endif
+ using TypoDuplicate::foobar;
+ using TypoDuplicate::goobar; // expected-error {{did you mean 'foobar'}}
+ };
+ struct TypoDuplicateDerived4 : TypoDuplicate {
+#if __cplusplus >= 201103L
+ using TypoDuplicate::TypoDuplicate; // expected-note {{previous}}
+ using TypoFuplicate::TypoDuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-error {{redeclaration}}
+#endif
+ };
}
namespace TypoCorrectTemplateMember {