Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(cpp) Misc fixes and improvements for function detection
- enh(cpp) Properly detect decltype(auto) - enh(cpp) recognize primitive types (`int8_t`, etc.) as function types - enh(cpp) Detect namespaced function types (`A::typeName func(...)`) - enh(cpp) Detect namespaced functions also (`A::functionName`) - enh(cpp) template type in function declaration (`vector<int> func(...)`) Closes #1730. Closes #1222. Closes #1502.
- Loading branch information
1 parent
b33ef93
commit ee8cf44
Showing
4 changed files
with
123 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<span class="hljs-function"><span class="hljs-keyword">decltype</span>(<span class="hljs-keyword">auto</span>) <span class="hljs-title">look_up_a_string_1</span><span class="hljs-params">()</span> </span>{ <span class="hljs-keyword">return</span> lookup1(); } | ||
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">look_up_a_string_2</span><span class="hljs-params">()</span> </span>{ <span class="hljs-keyword">return</span> lookup2(); } | ||
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">A::showB</span><span class="hljs-params">(B x)</span> </span>{} | ||
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">showB</span><span class="hljs-params">(B x)</span> </span>{} | ||
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">showB</span><span class="hljs-params">(B::SomeType x)</span> </span>{} | ||
<span class="hljs-function"><span class="hljs-keyword">inline</span> <span class="hljs-keyword">int</span> <span class="hljs-title">add</span><span class="hljs-params">(<span class="hljs-keyword">int</span> a, <span class="hljs-keyword">int</span> b)</span> </span>{} | ||
<span class="hljs-function">int8t <span class="hljs-title">Get_Tile_Value</span><span class="hljs-params">()</span> </span>{} | ||
|
||
<span class="hljs-function"><span class="hljs-keyword">int8_t</span> <span class="hljs-title">Get_Tile_Value</span><span class="hljs-params">()</span> </span>{} | ||
|
||
<span class="hljs-function">B::type <span class="hljs-title">test</span><span class="hljs-params">()</span> </span>{}; | ||
|
||
<span class="hljs-comment">// template</span> | ||
<span class="hljs-function">boost::optional<application> <span class="hljs-title">handle_key</span><span class="hljs-params">(application state, key_code key, coord size)</span></span>; | ||
|
||
test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
decltype(auto) look_up_a_string_1() { return lookup1(); } | ||
void look_up_a_string_2() { return lookup2(); } | ||
friend void A::showB(B x) {} | ||
friend void showB(B x) {} | ||
friend void showB(B::SomeType x) {} | ||
inline int add(int a, int b) {} | ||
int8t Get_Tile_Value() {} | ||
|
||
int8_t Get_Tile_Value() {} | ||
|
||
B::type test() {}; | ||
|
||
// template | ||
boost::optional<application> handle_key(application state, key_code key, coord size); | ||
|
||
test(); |