summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
commit27e0321aadb8c2c656af795612836cf896f0557d (patch)
tree7624fc2d71c047c04fe2c3c927b645f19760fdee /gcc/testsuite/g++.dg/cpp0x/lambda
parentcf4848768d6fbbbaec367eb8107504f1803091e2 (diff)
downloadgcc-27e0321aadb8c2c656af795612836cf896f0557d.tar.gz
2009-10-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152583 after the LTO merge inside trunk. [during merge with trunk 152583 the version information from GCC is used, not the checksum of the executable!] * gcc/melt-runtime.h (melt_gccversionstr): added extern declaration. * gcc/melt-runtime.c: Moved the #include before everything else. Updated comment NOTE about gengtype - which is now compatible with the trunk's. (melt_gccversionstr): added declaration. (load_checked_dynamic_module_index): use a gcc version string in modules, not a checksum of the executable. (melt_really_initialize): get a second argument for the gcc version string. Initialize melt_gccversionstr with it. (plugin_init): Build the gccversionstr out of gcc_version structure. (melt_initialize): calls melt_really_initialize with version_string. (melt_output_cfile_decl_impl): generates a genversionstr_melt instead of a genchecksum_melt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@152591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C8
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C
new file mode 100644
index 00000000000..bbc2a1ca52d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C
@@ -0,0 +1,14 @@
+// Test that capture by copy uses direct-initialization.
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+ A();
+ explicit A(const A&);
+};
+
+int main()
+{
+ A a;
+ [a]{};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C
new file mode 100644
index 00000000000..03c94e95981
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C
@@ -0,0 +1,8 @@
+// Test for the explicit initializer extension
+// { dg-options "-std=c++0x" }
+
+int main()
+{
+ int j = [i = 2]{sizeof(i); return i;}();
+ return (j != 2);
+}