diff options
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype32.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist57.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/diagnostic/expr1.C | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attr-used-1.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/life1.C | 2 |
6 files changed, 59 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype32.C b/gcc/testsuite/g++.dg/cpp0x/decltype32.C new file mode 100644 index 00000000000..66731cc947d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype32.C @@ -0,0 +1,12 @@ +// PR c++/50075 +// { dg-options -std=c++0x } + +template <typename T> +auto make_array(const T& il) -> // { dg-error "not declared" } +decltype(make_array(il)) +{ } + +int main() +{ + int z = make_array(1); // { dg-error "no match" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist57.C b/gcc/testsuite/g++.dg/cpp0x/initlist57.C new file mode 100644 index 00000000000..d945a468988 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist57.C @@ -0,0 +1,8 @@ +// PR c++/50054 +// { dg-options -std=c++0x } + +void g( const int& (a)[1] ) {} // { dg-error "array of references" } + +int main () { + g( { 1, 2 } ); // { dg-error "initializer list" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C b/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C new file mode 100644 index 00000000000..a8463de1980 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C @@ -0,0 +1,12 @@ +// PR c++/50086 +// { dg-options -std=c++0x } + +template<typename T> void tfun(); +template<typename T> void fun1(T); +template<typename... Types> void fun2(Types... args); + +int main() +{ + fun1(tfun<int>); // ok + fun2(tfun<int>); // error: unresolved overloaded function type +} diff --git a/gcc/testsuite/g++.dg/diagnostic/expr1.C b/gcc/testsuite/g++.dg/diagnostic/expr1.C new file mode 100644 index 00000000000..5651030d4ca --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/expr1.C @@ -0,0 +1,9 @@ +// PR c++/50059 + +int i; +struct A { }; +void f(A); +void g() +{ + f(i = 0); // { dg-error "i = 0" } +} diff --git a/gcc/testsuite/g++.dg/ext/attr-used-1.C b/gcc/testsuite/g++.dg/ext/attr-used-1.C new file mode 100644 index 00000000000..6754c7ffb50 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attr-used-1.C @@ -0,0 +1,17 @@ +// Attribute used on a member function or static data member +// of a template should cause them to be instantiated along +// with the class itself. + +// { dg-final { scan-assembler "_ZN1AIiE1fEv" } } +// { dg-final { scan-assembler "_ZN1AIiE1tE" } } + +template <class T> struct A +{ + void f() __attribute ((used)); + static T t __attribute ((used)); +}; + +template <class T> void A<T>::f() { } +template <class T> T A<T>::t; + +A<int> a; diff --git a/gcc/testsuite/g++.dg/opt/life1.C b/gcc/testsuite/g++.dg/opt/life1.C index 42fd7444693..dd840f9abec 100644 --- a/gcc/testsuite/g++.dg/opt/life1.C +++ b/gcc/testsuite/g++.dg/opt/life1.C @@ -1,6 +1,6 @@ // This testcase did not set up the pic register on IA-32 due // to bug in calculate_global_regs_live EH edge handling. -// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } +// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } } // { dg-require-effective-target fpic } // { dg-options "-O2 -fPIC" } |