File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -3703,17 +3703,17 @@ void Parser::ParseDeclarationSpecifiers(
3703
3703
// We reject AT_LifetimeBound and AT_AnyX86NoCfCheck, even though they
3704
3704
// are type attributes, because we historically haven't allowed these
3705
3705
// to be used as type attributes in C++11 / C23 syntax.
3706
- if (PA.getKind () == ParsedAttr::AT_LifetimeBound) {
3706
+ if (PA.isTypeAttr () && PA.getKind () != ParsedAttr::AT_LifetimeBound &&
3707
+ PA.getKind () != ParsedAttr::AT_AnyX86NoCfCheck)
3708
+ continue ;
3709
+
3710
+ if (PA.getKind () == ParsedAttr::AT_LifetimeBound)
3707
3711
Diag (PA.getLoc (), diag::err_attribute_wrong_decl_type_str)
3708
3712
<< PA << PA.isRegularKeywordAttribute ()
3709
3713
<< " parameters and implicit object parameters" ;
3710
- PA.setInvalid ();
3711
- continue ;
3712
- }
3713
- if (PA.isTypeAttr () && PA.getKind () != ParsedAttr::AT_AnyX86NoCfCheck)
3714
- continue ;
3715
- Diag (PA.getLoc (), diag::err_attribute_not_type_attr)
3716
- << PA << PA.isRegularKeywordAttribute ();
3714
+ else
3715
+ Diag (PA.getLoc (), diag::err_attribute_not_type_attr)
3716
+ << PA << PA.isRegularKeywordAttribute ();
3717
3717
PA.setInvalid ();
3718
3718
}
3719
3719
You can’t perform that action at this time.
0 commit comments