-
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #445 from andreasfertig/fixIssue404
Fixed #404: Unintentional swapping of array dimensions.
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.tmp.cpp:22:21: error: 'S' does not refer to a value | ||
S arr2[3][2] = S [3][2](); | ||
^ | ||
.tmp.cpp:1:8: note: declared here | ||
struct S | ||
^ | ||
.tmp.cpp:24:27: error: expected '(' for function-style cast or type construction | ||
T<int> arr3[3][2] = T<int>[3][2](); | ||
~~~~~~^ | ||
2 errors 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
struct S {}; | ||
template<typename> struct T {}; | ||
|
||
int arr1[3][2]; | ||
S arr2[3][2]; | ||
T<int> arr3[3][2]; |
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,25 @@ | ||
struct S | ||
{ | ||
// inline constexpr S() noexcept = default; | ||
}; | ||
|
||
|
||
template<typename> struct T {}; | ||
|
||
/* First instantiated from: Issue404.cpp:6 */ | ||
#ifdef INSIGHTS_USE_TEMPLATE | ||
template<> | ||
struct T<int> | ||
{ | ||
// inline constexpr T() noexcept = default; | ||
}; | ||
|
||
#endif | ||
|
||
|
||
int arr1[3][2]; | ||
|
||
S arr2[3][2] = S [3][2](); | ||
|
||
T<int> arr3[3][2] = T<int>[3][2](); | ||
|