diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2018-06-14 17:49:21 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2018-06-14 17:49:21 +0000 |
commit | d4d44753398f9b24a622b40c7a1d144a6a6c350c (patch) | |
tree | 73c7c44de846b441d8eefb17fc70e5dee81037bc /gcc/testsuite | |
parent | e9ecac306b972a45e2a6a4385bdf2bdc7f7ed68c (diff) | |
download | gcc-d4d44753398f9b24a622b40c7a1d144a6a6c350c.zip gcc-d4d44753398f9b24a622b40c7a1d144a6a6c350c.tar.gz gcc-d4d44753398f9b24a622b40c7a1d144a6a6c350c.tar.bz2 |
decl.c (duplicate_decls): Use DECL_SOURCE_LOCATION in OPT_Wshadow warning_at.
/cp
2018-06-14 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (duplicate_decls): Use DECL_SOURCE_LOCATION in
OPT_Wshadow warning_at.
(grokfndecl): Consistently use the location_t argument in
literal operator diagnostic messages.
(grokdeclarator): Use declspecs->locations[ds_storage_class]
in error_at call.
* decl2.c (finish_static_data_member_decl): Use DECL_SOURCE_LOCATION
in permerror call.
/testsuite
2018-06-14 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/other/static3.C: New.
* g++.dg/other/static4.C: Likewise.
* g++.dg/warn/Wshadow-15.C: Likewise.
* g++.dg/cpp0x/gnu_fext-numeric-literals.C: Test locations too.
* g++.dg/cpp0x/std_fext-numeric-literals.C: Likewise.
* g++.dg/cpp0x/std_fno-ext-numeric-literals.C: Likewise.
* g++.dg/cpp0x/udlit-args-neg.C: Likewise.
* g++.dg/cpp0x/udlit-clink-neg.C: Likewise.
* g++.dg/cpp0x/udlit-extern-c.C: Likewise.
* g++.dg/cpp0x/udlit-member-neg.C: Likewise.
From-SVN: r261601
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C | 64 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C | 64 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C | 32 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/udlit-args-neg.C | 24 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/udlit-clink-neg.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/udlit-extern-c.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/static3.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/static4.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wshadow-15.C | 7 |
11 files changed, 128 insertions, 95 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 74e5d85..ecf6554 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2018-06-14 Paolo Carlini <paolo.carlini@oracle.com> + + * g++.dg/other/static3.C: New. + * g++.dg/other/static4.C: Likewise. + * g++.dg/warn/Wshadow-15.C: Likewise. + * g++.dg/cpp0x/gnu_fext-numeric-literals.C: Test locations too. + * g++.dg/cpp0x/std_fext-numeric-literals.C: Likewise. + * g++.dg/cpp0x/std_fno-ext-numeric-literals.C: Likewise. + * g++.dg/cpp0x/udlit-args-neg.C: Likewise. + * g++.dg/cpp0x/udlit-clink-neg.C: Likewise. + * g++.dg/cpp0x/udlit-extern-c.C: Likewise. + * g++.dg/cpp0x/udlit-member-neg.C: Likewise. + 2018-06-14 Jakub Jelinek <jakub@redhat.com> PR target/85945 diff --git a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C index ac2db28..816077d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C +++ b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C @@ -4,73 +4,73 @@ // Integer imaginary... constexpr unsigned long long -operator"" i(unsigned long long n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(unsigned long long n) // { dg-warning "1:integer suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4 * n + 0; } constexpr unsigned long long -operator"" I(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" I(unsigned long long n) // { dg-warning "1:integer suffix .I. shadowed by implementation" } { return 4 * n + 1; } constexpr unsigned long long -operator"" j(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" j(unsigned long long n) // { dg-warning "1:integer suffix .j. shadowed by implementation" } { return 4 * n + 2; } constexpr unsigned long long -operator"" J(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowed by implementation" } { return 4 * n + 3; } // Floating-point imaginary... constexpr long double -operator"" i(long double n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4.0L * n + 0.0L; } constexpr long double -operator"" I(long double n) // { dg-warning "shadowed by implementation" } +operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" } { return 4.0L * n + 1.0L; } constexpr long double -operator"" j(long double n) // { dg-warning "shadowed by implementation" } +operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" } { return 4.0L * n + 2.0L; } constexpr long double -operator"" J(long double n) // { dg-warning "shadowed by implementation" } +operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" } { return 4.0L * n + 3.0L; } // Fixed-point... constexpr long double -operator"" k(long double n) // { dg-warning "shadowed by implementation" } +operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" } { return 4 * (n + 1) + 0; } constexpr long double -operator"" K(long double n) // { dg-warning "shadowed by implementation" } +operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" } { return 4 * (n + 1) + 1; } constexpr long double -operator"" r(long double n) // { dg-warning "shadowed by implementation" } +operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" } { return 4 * (n + 1) + 2; } constexpr long double -operator"" R(long double n) // { dg-warning "shadowed by implementation" } +operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" } { return 4 * (n + 1) + 3; } // Machine-defined... constexpr long double -operator"" w(long double n) // { dg-warning "shadowed by implementation" } +operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" } { return 4 * (n + 2) + 0; } constexpr long double -operator"" W(long double n) // { dg-warning "shadowed by implementation" } +operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" } { return 4 * (n + 2) + 1; } constexpr long double -operator"" q(long double n) // { dg-warning "shadowed by implementation" } +operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" } { return 4 * (n + 2) + 2; } constexpr long double -operator"" Q(long double n) // { dg-warning "shadowed by implementation" } +operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" } { return 4 * (n + 2) + 3; } int @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } diff --git a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C index ff1e7b6..72b8546 100644 --- a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C +++ b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C @@ -4,73 +4,73 @@ // Integer imaginary... constexpr unsigned long long -operator"" i(unsigned long long n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(unsigned long long n) // { dg-warning "1:integer suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4 * n + 0; } constexpr unsigned long long -operator"" I(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" I(unsigned long long n) // { dg-warning "1:integer suffix .I. shadowed by implementation" } { return 4 * n + 1; } constexpr unsigned long long -operator"" j(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" j(unsigned long long n) // { dg-warning "1:integer suffix .j. shadowed by implementation" } { return 4 * n + 2; } constexpr unsigned long long -operator"" J(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowed by implementation" } { return 4 * n + 3; } // Floating-point imaginary... constexpr long double -operator"" i(long double n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4.0L * n + 0.0L; } constexpr long double -operator"" I(long double n) // { dg-warning "shadowed by implementation" } +operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" } { return 4.0L * n + 1.0L; } constexpr long double -operator"" j(long double n) // { dg-warning "shadowed by implementation" } +operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" } { return 4.0L * n + 2.0L; } constexpr long double -operator"" J(long double n) // { dg-warning "shadowed by implementation" } +operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" } { return 4.0L * n + 3.0L; } // Fixed-point... constexpr long double -operator"" k(long double n) // { dg-warning "shadowed by implementation" } +operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" } { return 4 * (n + 1) + 0; } constexpr long double -operator"" K(long double n) // { dg-warning "shadowed by implementation" } +operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" } { return 4 * (n + 1) + 1; } constexpr long double -operator"" r(long double n) // { dg-warning "shadowed by implementation" } +operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" } { return 4 * (n + 1) + 2; } constexpr long double -operator"" R(long double n) // { dg-warning "shadowed by implementation" } +operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" } { return 4 * (n + 1) + 3; } // Machine-defined... constexpr long double -operator"" w(long double n) // { dg-warning "shadowed by implementation" } +operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" } { return 4 * (n + 2) + 0; } constexpr long double -operator"" W(long double n) // { dg-warning "shadowed by implementation" } +operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" } { return 4 * (n + 2) + 1; } constexpr long double -operator"" q(long double n) // { dg-warning "shadowed by implementation" } +operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" } { return 4 * (n + 2) + 2; } constexpr long double -operator"" Q(long double n) // { dg-warning "shadowed by implementation" } +operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" } { return 4 * (n + 2) + 3; } int @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } diff --git a/gcc/testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C index 0b245f4..b4f9d45 100644 --- a/gcc/testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C +++ b/gcc/testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-args-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-args-neg.C index d8d672e..b22fddd 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-args-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-args-neg.C @@ -5,37 +5,37 @@ class Foo { }; int -operator"" _Foo(); // { dg-error "has invalid argument list" } +operator"" _Foo(); // { dg-error "1:.int operator\"\"_Foo\\(\\). has invalid argument list" } Foo -operator"" _Foo(int *); // { dg-error "has invalid argument list" } +operator"" _Foo(int *); // { dg-error "1:.Foo operator\"\"_Foo\\(int\\*\\). has invalid argument list" } Foo -operator"" _Foo(unsigned long int); // { dg-error "has invalid argument list" } +operator"" _Foo(unsigned long int); // { dg-error "1:.Foo operator\"\"_Foo\\(long unsigned int\\). has invalid argument list" } Foo -operator"" _Foo(double); // { dg-error "has invalid argument list" } +operator"" _Foo(double); // { dg-error "1:.Foo operator\"\"_Foo\\(double\\). has invalid argument list" } Foo -operator"" _Foo(const float *, std::size_t); // { dg-error "has invalid argument list" } +operator"" _Foo(const float *, std::size_t); // { dg-error "1:.Foo operator\"\"_Foo\\(const float\\*, std::size_t\\). has invalid argument list" } Foo -operator"" _Foo(const wchar_t *, int); // { dg-error "has invalid argument list" } +operator"" _Foo(const wchar_t *, int); // { dg-error "1:.Foo operator\"\"_Foo\\(const wchar_t\\*, int\\). has invalid argument list" } Foo -operator"" _Foo(const char16_t *); // { dg-error "has invalid argument list" } +operator"" _Foo(const char16_t *); // { dg-error "1:.Foo operator\"\"_Foo\\(const char16_t\\*\\). has invalid argument list" } Foo -operator"" _Foo(char...); // { dg-error "has invalid argument list" } +operator"" _Foo(char...); // { dg-error "1:.Foo operator\"\"_Foo\\(char, \\.\\.\\.\\). has invalid argument list" } Foo -operator"" _Foo(unsigned long long int, char); // { dg-error "has invalid argument list" } +operator"" _Foo(unsigned long long int, char); // { dg-error "1:.Foo operator\"\"_Foo\\(long long unsigned int, char\\). has invalid argument list" } Foo -operator"" _Foo(const char *, std::size_t, int); // { dg-error "has invalid argument list" } +operator"" _Foo(const char *, std::size_t, int); // { dg-error "1:.Foo operator\"\"_Foo\\(const char\\*, std::size_t, int\\). has invalid argument list" } Foo -operator"" _Foo(long double &); // { dg-error "has invalid argument list" } +operator"" _Foo(long double &); // { dg-error "1:.Foo operator\"\"_Foo\\(long double&\\). has invalid argument list" } Foo -operator"" _Foo(std::size_t, const char16_t *); // { dg-error "has invalid argument list" } +operator"" _Foo(std::size_t, const char16_t *); // { dg-error "1:.Foo operator\"\"_Foo\\(std::size_t, const char16_t\\*\\). has invalid argument list" } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-clink-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-clink-neg.C index 87e0082..eb7ae8c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-clink-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-clink-neg.C @@ -3,6 +3,6 @@ extern "C" { int -operator"" _badclinkage(unsigned long long); // { dg-error "operator with C linkage" } +operator"" _badclinkage(unsigned long long); // { dg-error "1:literal operator with C linkage" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extern-c.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extern-c.C index d47a49c..7a38e12 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-extern-c.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extern-c.C @@ -2,6 +2,6 @@ extern "C" { // { dg-message "1: 'extern .C.' linkage started here" } -constexpr double operator"" _deg ( double degrees ); // { dg-error "literal operator with C linkage" } +constexpr double operator"" _deg ( double degrees ); // { dg-error "18:literal operator with C linkage" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C index b682066..f2eef0f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C @@ -4,7 +4,7 @@ class Foo { public: Foo() { } - int operator"" _Bar(char32_t); // { dg-error "must be a non-member function" } + int operator"" _Bar(char32_t); // { dg-error "7:.int Foo::operator\"\"_Bar\\(char32_t\\). must be a non-member function" } }; int i = operator"" _Bar(U'x'); // { dg-error "9:'operator\"\"_Bar' was not declared in this scope" } diff --git a/gcc/testsuite/g++.dg/other/static3.C b/gcc/testsuite/g++.dg/other/static3.C new file mode 100644 index 0000000..1d6b121 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/static3.C @@ -0,0 +1,7 @@ +void foo() +{ + struct S + { + static const int a = 0; // { dg-error "22:local class" } + }; +} diff --git a/gcc/testsuite/g++.dg/other/static4.C b/gcc/testsuite/g++.dg/other/static4.C new file mode 100644 index 0000000..94dc9b3 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/static4.C @@ -0,0 +1,6 @@ +// { dg-options -Wno-pedantic } + +void foo() +{ + static void bar(); // { dg-error "3:cannot declare static function" } +} diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-15.C b/gcc/testsuite/g++.dg/warn/Wshadow-15.C new file mode 100644 index 0000000..57ec881 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wshadow-15.C @@ -0,0 +1,7 @@ +// { dg-options "-Wshadow" } + +template<typename T> +void* operator new(__SIZE_TYPE__, T&); // { dg-warning "7:shadowing library function" } + +template<typename T> +void operator delete(void *, T&); // { dg-warning "6:shadowing library function" } |