forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR c++/92974 - bogus location for enum and non-enum in ?: warning.
build_min_non_dep wasn't setting any location so when we were emitting the warning in the following test while instantiating a template, its location was UNKNOWN_LOCATION. Rather than adding a location_t parameter, let's use the location from the original expression. * tree.c (build_min_non_dep): Use the location of NON_DEP when building the expression. * g++.dg/diagnostic/enum1.C: New test. * g++.dg/gomp/loop-2.C: Adjust dg-error. * g++.dg/gomp/for-21.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@279685 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
mpolacek
committed
Dec 20, 2019
1 parent
21aa9c8
commit 4397240
Showing
6 changed files
with
46 additions
and
18 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,14 @@ | ||
// PR c++/92974 - bogus location for enum and non-enum in ?: warning. | ||
// { dg-options "-Wextra" } | ||
|
||
enum { X }; | ||
|
||
struct S { | ||
template <typename T> | ||
void f(T) { unsigned int g(X ?: g); } // { dg-warning "enumerated and non-enumerated type in conditional expression" } | ||
}; | ||
|
||
struct S2 { | ||
S m; | ||
void l() { m.f(1); } | ||
}; |
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