mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pt.c (tsubst_copy): Only set TREE_USED on DECLs. * g++.dg/cpp0x/Wunused-variable-1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@237234 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
jakub
committed
Jun 8, 2016
1 parent
9300ead
commit 79a00c2
Showing
4 changed files
with
49 additions
and
1 deletion.
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,37 @@ | ||
// PR c++/71442 | ||
// { dg-do compile { target c++11 } } | ||
// { dg-options "-Wunused-variable" } | ||
|
||
struct C | ||
{ | ||
template<typename... Ts> | ||
int operator()(Ts &&...) | ||
{ | ||
return sizeof...(Ts); | ||
} | ||
}; | ||
|
||
int | ||
foo () | ||
{ | ||
C {} (1, 1L, 1LL, 1.0); | ||
} | ||
|
||
template<int N> | ||
void | ||
bar () | ||
{ | ||
char a; // { dg-warning "unused variable" } | ||
short b; // { dg-warning "unused variable" } | ||
int c; // { dg-warning "unused variable" } | ||
long d; // { dg-warning "unused variable" } | ||
long long e; // { dg-warning "unused variable" } | ||
float f; // { dg-warning "unused variable" } | ||
double g; // { dg-warning "unused variable" } | ||
} | ||
|
||
void | ||
baz () | ||
{ | ||
bar <0> (); | ||
} |