|
|
| Bugzilla Link |
46243 |
| Version |
10.0 |
| OS |
Windows NT |
| Reporter |
LLVM Bugzilla Contributor |
| CC |
@mydeveloperday |
Extended Description
When using the [[no_discard]] attribute between the class / struct keyword and the type name, the reference '&' will be misplaced in declared member functions taking types references as parameters.
For example, if I have the PointerAlignment attribute set to Left:
struct Toto
{
Toto(Object& obj);
void Function(Object& obj1, Object& obj2);
};
when "[[nodiscard]]" is added, becomes:
struct [[nodiscard]] Toto
{
Toto(Object & obj);
void Function(Object & obj1, Object & obj2);
};
(note the space between 'Object' and '&').
This bug only happens if 'Object' is not a primitive type (so can be class, a struct, templated or not, an enum, an enum class, an alias), if the reference is not constant, if the function is not an operator (can be a constructor, a member function, a static member function) and if the argument is not put after another argument which is a primitive type, a primitive type reference or any constant type reference.