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++/79503 - inherited ctor taking base class
* call.c (add_function_candidate): Also check that DECL_INHERITED_CTOR_BASE is reference-related to the parameter type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245586 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
jason
committed
Feb 20, 2017
1 parent
ad2c271
commit 67378ae
Showing
3 changed files
with
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// PR c++/79503 | ||
// { dg-do compile { target c++11 } } | ||
|
||
struct payload {}; | ||
|
||
struct base: private payload { | ||
base(payload) {} | ||
}; | ||
|
||
struct derived: base { | ||
using base::base; | ||
}; | ||
|
||
int main() | ||
{ | ||
payload data; | ||
// error: no matching function for call to 'derived::derived(payload&)' | ||
// note: candidate: base::base(payload) | ||
// note: an inherited constructor is not a candidate for initialization from an expression of the same or derived type | ||
derived demo(data); | ||
} |