Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaDeclCXX.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,421 Lines • ▼ Show 20 Lines | if (isInstField) { | ||||
} | } | ||||
if (D.getName().getKind() == UnqualifiedIdKind::IK_TemplateId) { | if (D.getName().getKind() == UnqualifiedIdKind::IK_TemplateId) { | ||||
Diag(D.getIdentifierLoc(), diag::err_member_with_template_arguments) | Diag(D.getIdentifierLoc(), diag::err_member_with_template_arguments) | ||||
<< II | << II | ||||
<< SourceRange(D.getName().TemplateId->LAngleLoc, | << SourceRange(D.getName().TemplateId->LAngleLoc, | ||||
D.getName().TemplateId->RAngleLoc) | D.getName().TemplateId->RAngleLoc) | ||||
<< D.getName().TemplateId->LAngleLoc; | << D.getName().TemplateId->LAngleLoc; | ||||
D.setInvalidType(); | |||||
erichkeane: I see we are diagnosing this ONLY inside of the case where it is a template. Where is this… | |||||
CheckCompletedCXXClass should catch diag::err_member_name_of_class. However, these FieldDecl have no name hence uncaught. Maybe we should set the identifier for this declarator here. rZhBoYao: CheckCompletedCXXClass should catch diag::err_member_name_of_class. However, these FieldDecl… | |||||
I'm not sure what the side effect of that is... Can you give it a shot? erichkeane: I'm not sure what the side effect of that is... Can you give it a shot? | |||||
} | } | ||||
if (SS.isSet() && !SS.isInvalid()) { | if (SS.isSet() && !SS.isInvalid()) { | ||||
// The user provided a superfluous scope specifier inside a class | // The user provided a superfluous scope specifier inside a class | ||||
// definition: | // definition: | ||||
// | // | ||||
// class X { | // class X { | ||||
// int X::member; | // int X::member; | ||||
▲ Show 20 Lines • Show All 14,914 Lines • Show Last 20 Lines |
I see we are diagnosing this ONLY inside of the case where it is a template. Where is this caught when we are in the non-template case, why doesn't THAT catch these cases, and what would it take to do so?