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.
* constexpr.c (register_constexpr_fundef): Keep the un-massaged body. (cxx_eval_call_expression): Don't look through clones. * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias. * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of maybe-in-charge *tor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232848 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
jason
committed
Jan 26, 2016
1 parent
58b0f9c
commit 6a38515
Showing
5 changed files
with
47 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// PR c++/68949 | ||
// { dg-do run { target c++11 } } | ||
|
||
struct Sub { | ||
int i; | ||
|
||
constexpr Sub() : i(-1) {} // remove constexpr and it works as expected | ||
Sub(Sub&& rhs); // remove this constructor and it works as epxected. | ||
}; | ||
|
||
// v-- move this inline and it works as expected | ||
// v-- remove ': Sub()' and it works as expected | ||
Sub::Sub(Sub&& rhs) : Sub() { int tmp = i; i = rhs.i; rhs.i = tmp; } | ||
|
||
struct Class { | ||
// v-- remove '[1]' and it works as expected | ||
// v-- add '= {}' and it works as expected | ||
Sub s[1]; | ||
|
||
// v-- add ': s{}' and it works as expected | ||
// v-- removing this constructor makes it work as expected | ||
Class() {} | ||
}; | ||
|
||
int main() { | ||
Class c; | ||
if (c.s[0].i != -1) | ||
__builtin_abort(); | ||
} |