File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88// gcc -E -dM - < /dev/null
99
1010#include < iostream>
11+ #include < stdexcept>
1112
1213// [[deprecated]] // c+14 or later
13- // [[gnu::deprecated]] // c+11 or later
14+ [[gnu::deprecated]] // c+11 or later
1415int old_func ()
1516{
16- // [[gnu::deprecated]]
17+ // [[gnu::deprecated("I hate this") ]]
1718 int value = 0 ;
1819
1920 return value;
@@ -33,6 +34,12 @@ void last_func()
3334 printf (" after main()\n " );
3435}
3536
37+ [[gnu::always_inline]] inline
38+ int get_num ()
39+ {
40+ return 42 ;
41+ }
42+
3643void case1 ()
3744{
3845 using namespace std ;
@@ -43,16 +50,24 @@ void case1()
4350 cout << " case1" << endl;
4451}
4552
53+ [[gnu::hot]]
4654void case2 ()
4755{
4856 using namespace std ;
4957
5058 cout << " case2" << endl;
5159}
5260
61+ [[noreturn]]
62+ int case3 (bool flag)
63+ {
64+ throw std::runtime_error (" XXX" );
65+ }
66+
5367int main ()
5468{
55- // old_func();
69+ old_func ();
70+ get_num ();
5671
5772 case1 ();
5873 case2 ();
You can’t perform that action at this time.
0 commit comments