-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Due to another issue (#255) the result of this issue does not compile. This will be fixed with #255.
- Loading branch information
1 parent
a322252
commit 4eca8c3
Showing
12 changed files
with
100 additions
and
16 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
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,15 @@ | ||
struct demonstrator{ | ||
template <typename return_type = double> | ||
return_type templated_function() { | ||
return return_type{}; | ||
} | ||
}; | ||
|
||
int demonstrate() { | ||
demonstrator D; | ||
D.template templated_function<bool>(); | ||
D.template templated_function<float>(); | ||
D.template templated_function(); | ||
return 42; | ||
} | ||
|
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,52 @@ | ||
struct demonstrator | ||
{ | ||
template<typename return_type = double> | ||
inline return_type templated_function() | ||
{ | ||
return return_type{{}}; | ||
} | ||
|
||
/* First instantiated from: Issue254.cpp:10 */ | ||
#ifdef INSIGHTS_USE_TEMPLATE | ||
template<> | ||
inline bool templated_function<bool>() | ||
{ | ||
return bool{}; | ||
} | ||
#endif | ||
|
||
|
||
/* First instantiated from: Issue254.cpp:11 */ | ||
#ifdef INSIGHTS_USE_TEMPLATE | ||
template<> | ||
inline float templated_function<float>() | ||
{ | ||
return float{}; | ||
} | ||
#endif | ||
|
||
|
||
/* First instantiated from: Issue254.cpp:12 */ | ||
#ifdef INSIGHTS_USE_TEMPLATE | ||
template<> | ||
inline double templated_function<double>() | ||
{ | ||
return double{}; | ||
} | ||
#endif | ||
|
||
// inline constexpr demonstrator() noexcept = default; | ||
}; | ||
|
||
|
||
|
||
int demonstrate() | ||
{ | ||
demonstrator D = demonstrator(); | ||
D.templated_function<bool>(); | ||
D.templated_function<float>(); | ||
D.templated_function<double>(); | ||
return 42; | ||
} | ||
|
||
|
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,7 @@ | ||
.tmp.cpp:37:5: error: no matching member function for call to 'foo' | ||
t.foo<__lambda_13_12>(__lambda_13_12); | ||
~~^~~~~~~~~~~~~~~~~~~ | ||
.tmp.cpp:6:15: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T' | ||
inline void foo(T &&) | ||
^ | ||
1 error generated. |
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 |
---|---|---|
|
@@ -34,6 +34,6 @@ int main() | |
|
||
} __lambda_13_12{}; | ||
|
||
t.foo(__lambda_13_12); | ||
t.foo<__lambda_13_12>(__lambda_13_12); | ||
} | ||
|
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,7 @@ | ||
.tmp.cpp:84:5: error: no matching member function for call to 'Do' | ||
f.Do<__lambda_33_10>(__lambda_33_10); | ||
~~^~~~~~~~~~~~~~~~~~ | ||
.tmp.cpp:9:15: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T' | ||
inline void Do(T && t) | ||
^ | ||
1 error generated. |
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