Do not pass null attributes to BuildAttributedStmt during instantiation
authorAaron Ballman <aaron@aaronballman.com>
Wed, 21 Apr 2021 13:25:00 +0000 (09:25 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 21 Apr 2021 13:30:56 +0000 (09:30 -0400)
commita63c9b25620c8a4da9fcf1e1e8535d3110819ec0
tree981129746a3b5dea24fb3180a4eab5cbebf1c76d
parentfa404ae43a6f7ed256a47257aeccc760d16dc0c9
Do not pass null attributes to BuildAttributedStmt during instantiation

When transforming an attribute during template instantiation, if the
transformation fails, it may result in a null attribute being returned.
This null attribute should not be passed in as one of the attributes
used to create an attributed statement.

If all of the attributes fail to transform, we do not create an
attributed statement at all.

There are no attributes that return null currently, so there is no easy
way to test this currently. However, this fixes a crash caused by
8344675908424ee532d4ae30e5043c5a5834e02c.
clang/lib/Sema/TreeTransform.h