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.
Implement P0195R2, C++17 variadic using.
* parser.c (cp_parser_using_declaration): Handle ellipsis and comma. * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE. * error.c (dump_decl): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244246 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
jason
committed
Jan 9, 2017
1 parent
d0abd9e
commit caba101
Showing
7 changed files
with
119 additions
and
13 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
// Test for P0195R2 variadic using. | |||
// { dg-do compile { target c++11 } } | |||
// { dg-options "" } | |||
|
|||
struct A { void f(); }; | |||
struct B { void f(int); }; | |||
|
|||
template <class... Bases> struct C: Bases... | |||
{ | |||
using Bases::f...; // { dg-warning "pack expansion" "" { target c++14_down } } | |||
}; | |||
|
|||
int main() | |||
{ | |||
C<A,B> c; | |||
c.f(); | |||
c.f(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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
// Test for P0195R2 multiple using. | |||
// { dg-options "" } | |||
|
|||
namespace A { | |||
int i; | |||
} | |||
|
|||
namespace A1 { | |||
using A::i, A::i; // OK: double declaration | |||
// { dg-warning "comma" "" { target c++14_down } .-1 } | |||
} | |||
|
|||
struct B { | |||
int i; | |||
}; | |||
|
|||
struct X : B { | |||
using B::i, B::i; // { dg-error "redeclaration" } | |||
// { dg-warning "comma" "" { target c++14_down } .-1 } | |||
}; |