diff options
author | ville <ville@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-28 08:22:15 +0000 |
---|---|---|
committer | ville <ville@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-28 08:22:15 +0000 |
commit | e53187927ba5310336b8a85242704068491ec826 (patch) | |
tree | 2f388984bf65046a29d0ad233d65a85e6403373f | |
parent | fe95391f58ece33f0fe545c3599bf55869a56aac (diff) | |
download | gcc-e53187927ba5310336b8a85242704068491ec826.tar.gz |
Revert the attempted fix for c++/69855, it breaks bootstrap.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236844 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/name-lookup.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/overload/69855.C | 44 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/missed-error2.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/crash3.C | 4 |
4 files changed, 5 insertions, 68 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 11733700627..cbd52095575 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -929,24 +929,6 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend) DECL_ANTICIPATED (t) = 1; DECL_HIDDEN_FRIEND_P (t) = 1; } - - if (TREE_CODE (x) == FUNCTION_DECL - && DECL_LOCAL_FUNCTION_P (x) - && !DECL_OMP_DECLARE_REDUCTION_P (x) - && !type_dependent_expression_p (x)) - { - /* PR c++/69855, a local function declaration - is stripped from template info and pushed to - the local scope as a hidden declaration. This - allows ill-formed overloads even in other scopes - to be diagnosed both at the local declaration site - and after it. */ - tree t2 = copy_decl (t); - DECL_USE_TEMPLATE (t2) = 0; - DECL_TEMPLATE_INFO (t2) = NULL_TREE; - DECL_ANTICIPATED (t2) = 1; - push_overloaded_decl (t2, PUSH_GLOBAL, is_friend); - } } if (t != x || DECL_FUNCTION_TEMPLATE_P (t)) diff --git a/gcc/testsuite/g++.dg/overload/69855.C b/gcc/testsuite/g++.dg/overload/69855.C deleted file mode 100644 index dc2d7337032..00000000000 --- a/gcc/testsuite/g++.dg/overload/69855.C +++ /dev/null @@ -1,44 +0,0 @@ -// PR c++/69855 -// { dg-do compile } - -int get(); -void f() { - char get(); // { dg-error "ambiguating" } -} - -int get2(); -char get2(int); -void f2() { - char get2(); // { dg-error "ambiguating" } -} - -char get3(int); -void f3() { - char get3(); -} - -void f4() { - char get4(); -} -int get4(); // { dg-error "ambiguating" } - -void get5(); - -template <class T> struct X -{ - void g() - { - int get5(); // { dg-error "ambiguating" } - } -}; - - -template <class T> struct X2 -{ - void g() - { - int get6(); - } -}; - -void get6(); // { dg-error "ambiguating" } diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C index 26ae87d7a2e..42f70aeb997 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C @@ -25,10 +25,9 @@ int main() { foo(4, -37, 14.39, 14.38); } -// 971006 we no longer gave an error for this since we emit a hard error -// about the declaration above, but after the fix for PR c++/69855 -// this declaration emits a diagnostic again -static void foo(int i, int j, double x, double y) { // { dg-error "extern|static" } +// 971006 we no longer give an error for this since we emit a hard error +// about the declaration above +static void foo(int i, int j, double x, double y) { std::cout << "Max(int): " << max(i,j) << " Max(double): " << max(x,y) << '\n'; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash3.C b/gcc/testsuite/g++.old-deja/g++.pt/crash3.C index 2ba61d9cdb9..160cbe541a1 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash3.C @@ -10,7 +10,7 @@ public: } CVector<long> g() const { - CVector<long> v2(); - return v2; + CVector<long> v(); + return v; } }; |