struct a
{
[[noreturn]] friend int b();
};
[[noreturn]] int b(){ throw 42; }
< /code>
Dies kann sowohl auf GCC als auch auf Clang kompilieren: < /p>
GCC-Fehlermeldung: < /p>
warning: attribute ignored [-Wattributes]
X | [[noreturn]] friend int b();
| ^
note: an attribute that appertains to a friend declaration that is not a definition is ignored
error: function 'int b()' declared '[[noreturn]]' but its first declaration was not
Y | [[noreturn]] int b(){ throw 42; }
| ^
:5:29: note: previous declaration of 'int b()'
X | [[noreturn]] friend int b();
| ^
< /code>
Clang-Fehlermeldung: < /p>
error: an attribute list cannot appear here
X | [[noreturn]] friend int b();
| ^~~~~~~~~~~~
error: 'noreturn' attribute does not appear on the first declaration
Y | [[noreturn]] int b(){ throw 42; }
| ^
note: previous declaration is here
X | [[noreturn]] friend int b();
| ^
[url=viewtopic.php?t=14917]Ich möchte[/url] eine Freundungsfunktion einer Klasse als [[Noreturn]] deklarieren, aber ich kann die richtige Syntax nicht ermitteln. [code]struct a { [[noreturn]] friend int b(); };
[[noreturn]] int b(){ throw 42; } < /code> Dies kann sowohl auf GCC als auch auf Clang kompilieren: < /p> GCC-Fehlermeldung: < /p> warning: attribute ignored [-Wattributes] X | [[noreturn]] friend int b(); | ^ note: an attribute that appertains to a friend declaration that is not a definition is ignored error: function 'int b()' declared '[[noreturn]]' but its first declaration was not Y | [[noreturn]] int b(){ throw 42; } | ^ :5:29: note: previous declaration of 'int b()' X | [[noreturn]] friend int b(); | ^ < /code> Clang-Fehlermeldung: < /p> error: an attribute list cannot appear here X | [[noreturn]] friend int b(); | ^~~~~~~~~~~~ error: 'noreturn' attribute does not appear on the first declaration Y | [[noreturn]] int b(){ throw 42; } | ^ note: previous declaration is here X | [[noreturn]] friend int b(); | ^ [/code]
Ich verwende ng-repeat, um eine Liste von Elementen auf der Seite anzuzeigen.
Ermöglicht den Benutzer die Auswahl einer Auswahl und klicken Sie dann auf die Schaltfläche Speichern . Übergeben des...
Ich verwende ng-repeat, um eine Liste von Elementen auf der Seite anzuzeigen.
Ermöglicht den Benutzer die Auswahl einer Auswahl und klicken Sie dann auf die Schaltfläche Speichern . Übergeben des...