public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization
@ 2013-11-04 23:52 cvs at cs dot utoronto.ca
  2013-11-05 11:59 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: cvs at cs dot utoronto.ca @ 2013-11-04 23:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

            Bug ID: 58993
           Summary: failure to access pointer to protected member method
                    in base from derived class specialization
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cvs at cs dot utoronto.ca

Sample code:

class base {
protected:
    typedef void (base::*foo_type)() const;
    void foo() const {}
};

template <typename T>
struct bar : public base {
    foo_type test() { 
        return &base::foo;       // OK
    }
};

template <>
struct bar<void> : public base {
    using base::foo;
    foo_type test() { 
        foo();                   // OK
        base::foo();             // OK
        foo_type x = &bar::foo;  // OK
        return &base::foo;       // error
    }
};

int main() {
    bar<int>().test();
    bar<void>().test();
    return 0;
}

Compiler output:
protected_base.cpp: In member function ‘void (base::*
bar<void>::test())()const’:
protected_base.cpp:5:10: error: ‘void base::foo() const’ is protected
protected_base.cpp:22:23: error: within this context

Version:
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
>From gcc-bugs-return-433511-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 05 00:14:33 2013
Return-Path: <gcc-bugs-return-433511-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11436 invoked by alias); 5 Nov 2013 00:14:33 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8376 invoked by uid 48); 5 Nov 2013 00:12:30 -0000
From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/58994] New: asan.exp regressions on x86_64 darwin at -m64 but not -m32 at r204372
Date: Tue, 05 Nov 2013 00:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: howarth at nitro dot med.uc.edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc
Message-ID: <bug-58994-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg00288.txt.bz2
Content-length: 16768

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58994

            Bug ID: 58994
           Summary: asan.exp regressions on x86_64 darwin at -m64 but not
                    -m32 at r204372
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: howarth at nitro dot med.uc.edu
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

With the remerge of libsanitizer, the following test cases fail on
x86_64-apple-darwin12 at -m64 but not at -m32 (which shows no regressions)…

Native configuration is x86_64-apple-darwin12.5.0

        === g++ tests ===


Running target unix/-m32

        === g++ Summary for unix/-m32 ===

# of expected passes        473
# of unsupported tests        132

Running target unix/-m64
FAIL: c-c++-common/asan/global-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O0  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O1  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O2  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O3 -fomit-frame-pointer  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -Os  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O2 -flto -flto-partition=none  execution
test
FAIL: c-c++-common/asan/memcmp-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O0  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O1  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/null-deref-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -Os  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O0  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O1  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -Os  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2 -flto -flto-partition=none
 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2  execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2  execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O0  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O1  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/use-after-free-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -Os  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2 -flto  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -O0  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -O1  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -O2  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -O3 -fomit-frame-pointer  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -O3 -g  execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C  -Os  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O0  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O1  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O2  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O3 -fomit-frame-pointer  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O3 -g  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -Os  execution test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O2 -flto -flto-partition=none  execution
test
FAIL: g++.dg/asan/deep-tail-call-1.C  -O2 -flto  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O0  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O1  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O2  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O3 -fomit-frame-pointer  execution
test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O3 -g  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -Os  execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O2 -flto -flto-partition=none 
execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C  -O2 -flto  execution test
FAIL: g++.dg/asan/interception-failure-test-1.C  -O0  output pattern test, is
==75792==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O1  output pattern test, is
==75806==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O2  output pattern test, is
==75820==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O3 -fomit-frame-pointer 
output pattern test, is ==75834==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O3 -g  output pattern test,
is ==75848==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -Os  output pattern test, is
==75862==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O2 -flto -flto-partition=none
 output pattern test, is ==75886==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C  -O2 -flto  output pattern
test, is ==75912==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131104/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/large-func-test-1.C  -O0  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O1  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O2  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O3 -fomit-frame-pointer  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O3 -g  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -Os  execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O2 -flto -flto-partition=none 
execution test
FAIL: g++.dg/asan/large-func-test-1.C  -O2 -flto  execution test
FAIL: g++.dg/asan/symbolize-callback-1.C  -O2  execution test
FAIL: g++.dg/asan/symbolize-callback-1.C  -O2 -flto -flto-partition=none 
execution test
FAIL: g++.dg/asan/symbolize-callback-1.C  -O2 -flto  execution test

        === g++ Summary for unix/-m64 ===

# of expected passes        259
# of unexpected failures    111
# of unsupported tests        132

        === g++ Summary ===

# of expected passes        732
# of unexpected failures    111
# of unsupported tests        264
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/testsuite/g++/../../xg++ 
version 4.9.0 20131104 (experimental) (GCC) 

        === gcc tests ===


Running target unix/-m32

        === gcc Summary for unix/-m32 ===

# of expected passes        318
# of unsupported tests        101

Running target unix/-m64
FAIL: c-c++-common/asan/global-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/global-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/heap-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O0  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O1  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O2  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O3 -fomit-frame-pointer  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -Os  execution test
FAIL: c-c++-common/asan/memcmp-1.c  -O2 -flto -flto-partition=none  execution
test
FAIL: c-c++-common/asan/memcmp-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O0  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O1  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/null-deref-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -Os  execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/null-deref-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O0  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O1  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -Os  execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2 -flto -flto-partition=none
 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2  execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/stack-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2  execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O0  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O1  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O3 -fomit-frame-pointer 
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -Os  execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c  -O2 -flto  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O0  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O1  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O3 -fomit-frame-pointer  execution
test
FAIL: c-c++-common/asan/use-after-free-1.c  -O3 -g  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -Os  execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2 -flto -flto-partition=none 
execution test
FAIL: c-c++-common/asan/use-after-free-1.c  -O2 -flto  execution test

        === gcc Summary for unix/-m64 ===

# of expected passes        178
# of unexpected failures    70
# of unsupported tests        101

        === gcc Summary ===

# of expected passes        496
# of unexpected failures    70
# of unsupported tests        202

Compiler version: 4.9.0 20131104 (experimental) (GCC) 
Platform: x86_64-apple-darwin12.5.0
configure flags: --prefix=/sw --prefix=/sw/lib/gcc4.9 --mandir=/sw/share/man
--infodir=/sw/lib/gcc4.9/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-isl=/sw --with-cloog=/sw --with-mpc=/sw
--with-system-zlib --enable-checking=yes --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.9
>From gcc-bugs-return-433512-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 05 00:23:02 2013
Return-Path: <gcc-bugs-return-433512-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22852 invoked by alias); 5 Nov 2013 00:23:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19316 invoked by uid 48); 5 Nov 2013 00:21:00 -0000
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/58995] New: Use of -ldl in libcilkrts breaks bootstrap
Date: Tue, 05 Nov 2013 00:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: kargl at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-58995-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg00289.txt.bz2
Content-length: 1185

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX995

            Bug ID: 58995
           Summary: Use of -ldl in libcilkrts breaks bootstrap
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org

bsupc++/.libs -lpthread -ldl -L/home/sgk/gcc/obj4x/./gcc
/home/sgk/gcc/obj4x/x86_64-unknown-freebsd10.0/libstdc++-v3/src/.libs/libstdc++.so
-lm -lc -lgcc_s /home/sgk/gcc/obj4x/./gcc/crtendS.o /usr/lib/crtn.o
-Wl,-soname -Wl,libcilkrts.so.5 -o .libs/libcilkrts.so.5
/usr/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
gmake[2]: *** [libcilkrts.la] Error 1
gmake[2]: Leaving directory
`/usr/home/sgk/gcc/obj4x/x86_64-unknown-freebsd10.0/libcilkrts'
gmake[1]: *** [all-target-libcilkrts] Error 2
gmake[1]: Leaving directory `/usr/home/sgk/gcc/obj4x'
gmake: *** [all] Error 2


This is caused by the hardcoded reference to libdl.


troutmask:sgk[319] grep ldl libcilkrts/Makefile.am
AM_LDFLAGS = -lpthread -ldl
libcilkrts_la_LDFLAGS += -lpthread -ldl

Please fix.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
@ 2013-11-05 11:59 ` redi at gcc dot gnu.org
  2013-11-05 13:37 ` cvs at cs dot utoronto.ca
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-05 11:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-05
             Blocks|                            |59002
            Summary|failure to access pointer   |incorrectly accept access
                   |to protected member method  |of protected member method
                   |in base from derived class  |from derived class template
                   |specialization              |
     Ever confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced test, where the base member is private, but the primary template can
still access it

class base {
private:
    int foo() { }
};

template <typename T>
struct bar : public base {
    void test() {
        &base::foo;  // should be rejected
    }
};

template <>
struct bar<void> : public base {
    void test() {
        // &base::foo;  // correctly rejected
    }
};

int main() {
    bar<int>().test();
    bar<void>().test();
}


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
  2013-11-05 11:59 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template redi at gcc dot gnu.org
@ 2013-11-05 13:37 ` cvs at cs dot utoronto.ca
  2021-01-12 16:58 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs at cs dot utoronto.ca @ 2013-11-05 13:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

--- Comment #3 from Chris Studholme <cvs at cs dot utoronto.ca> ---
Ah, thanks for the info.  I thought I tried '&bar::foo' and it didn't work
without 'using base::foo'.  I just tried it again and it does work (in both
cases) without the using declaration so I must have made some other mistake
earlier.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
  2013-11-05 11:59 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template redi at gcc dot gnu.org
  2013-11-05 13:37 ` cvs at cs dot utoronto.ca
@ 2021-01-12 16:58 ` ppalka at gcc dot gnu.org
  2021-01-19 21:20 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-01-12 16:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org

--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> Warning-free testcase:
> 
> class base {
> private:
>     void foo() { }
> };
> 
> template <typename T>
> struct bar : public base {
>     void test() {
>         (void) &base::foo;  // should be rejected
>     }
> };
> 
> template <>
> struct bar<void> : public base {
>     void test() {
>         // &base::foo;  // correctly rejected
>     }
> };
> 
> int main() {
>     bar<int>().test();
>     bar<void>().test();
> }
> 
> Still accepted by trunk.
> 
> 
> Clang says:
> 
> 58993.cc:9:23: error: 'foo' is a private member of 'base'
>         (void) &base::foo;  // should be rejected
>                       ^
> 58993.cc:3:10: note: declared private here
>     void foo() { }
>          ^
> 1 error generated.
> 
> 
> and EDG says:
> 
> "58993.cc", line 9: error: function "base::foo" (declared at line 3) is
>           inaccessible
>           (void) &base::foo;  // should be rejected
>                         ^
>           detected during instantiation of "void bar<T>::test() [with T=int]"
>                     at line 21
> 
> 1 error detected in the compilation of "58993.cc".

With GCC 11 (after the PR41437 patch), we reject the first access only if
bar<T>::test() is defined out-of-line:

class base {
private:
    int foo() { }
};

template <typename T>
struct bar : public base {
    void test();
};

template <typename T>
void bar<T>::test() {
    &base::foo;
}

int main() {
    bar<int>().test();
}

Investigating.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
                   ` (2 preceding siblings ...)
  2021-01-12 16:58 ` ppalka at gcc dot gnu.org
@ 2021-01-19 21:20 ` cvs-commit at gcc dot gnu.org
  2021-01-20 14:52 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-19 21:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:29853c653245c37ed31b6abcc9799b534372e938

commit r11-6800-g29853c653245c37ed31b6abcc9799b534372e938
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Jan 19 16:20:00 2021 -0500

    c++: Always check access during late-parsing of members [PR58993]

    This patch removes a vestigial use of dk_no_check from
    cp_parser_late_parsing_for_member, which ideally should have been
    removed as part of the PR41437 patch that improved access checking
    inside templates.  This allows us to correctly reject f1 and f2 in
    the testcase access34.C below (whereas before we'd only reject f3).

    Additional testing revealed a new access issue when late-parsing a hidden
    friend within a class template.  In the testcase friend68.C below, we're
    tripping over the checking assert from friend_accessible_p(f, S::j, S, S)
    during lookup of j in x.j (for which type_dependent_object_expression_p
    returns false, which is why we're doing the lookup at parse time).  The
    reason for the assert failure is that DECL_FRIENDLIST(S) contains f but
    DECL_BEFRIENDING_CLASSES(f) is empty, and so friend_accessible_p (which
    looks at DECL_BEFRIENDING_CLASSES) wants to return false, but is_friend
    (which looks at DECL_FRIENDLIST) returns true.

    For sake of symmetry one would expect that DECL_BEFRIENDING_CLASSES(f)
    contains S, but add_friend avoids updating DECL_BEFRIENDING_CLASSES when
    the class type (S in this case) is dependent, for some reason.

    This patch works around this issue by making friend_accessible_p
    consider the DECL_FRIEND_CONTEXT of the access scope.  Thus we sidestep
    the DECL_BEFRIENDING_CLASSES / DECL_FRIENDLIST asymmetry issue while
    correctly validating the x.j access at parse time.

    A earlier version of this patch checked friend_accessible_p instead of
    protected_accessible_p in the DECL_FRIEND_CONTEXT hunk below, but this
    had the side effect of making us accept the ill-formed testcase friend69.C
    below (ill-formed because the hidden friend g is not actually a member
    of A, so g doesn't have access to B's members despite B befriending A).

    gcc/cp/ChangeLog:

            PR c++/41437
            PR c++/58993
            * search.c (friend_accessible_p): If scope is a hidden friend
            defined inside a dependent class, consider access from the
            class.
            * parser.c (cp_parser_late_parsing_for_member): Don't push a
            dk_no_check access state.

    gcc/testsuite/ChangeLog:

            PR c++/41437
            PR c++/58993
            * g++.dg/opt/pr87974.C: Adjust.
            * g++.dg/template/access34.C: New test.
            * g++.dg/template/friend68.C: New test.
            * g++.dg/template/friend69.C: New test.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
                   ` (3 preceding siblings ...)
  2021-01-19 21:20 ` cvs-commit at gcc dot gnu.org
@ 2021-01-20 14:52 ` ppalka at gcc dot gnu.org
  2022-05-15 16:45 ` cvs-commit at gcc dot gnu.org
  2022-06-02 13:29 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-01-20 14:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
                   ` (4 preceding siblings ...)
  2021-01-20 14:52 ` ppalka at gcc dot gnu.org
@ 2022-05-15 16:45 ` cvs-commit at gcc dot gnu.org
  2022-06-02 13:29 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-15 16:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:4df735e01e319997841574f353d2aa076a0335c2

commit r13-465-g4df735e01e319997841574f353d2aa076a0335c2
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 18 22:52:32 2022 -0400

    c++: hidden friend access [DR1699]

    It has come up several times that Clang considers hidden friends of a class
    to be sufficiently memberly to be covered by a friend declaration naming
the
    class.  This is somewhat unclear in the standard: [class.friend] says
    "Declaring a class to be a friend implies that private and protected
members
    of the class granting friendship can be named in the base-specifiers and
    member declarations of the befriended class."

    A hidden friend is a syntactic member-declaration, but is it a "member
    declaration"?  CWG was ambivalent, and referred the question to EWG as a
    design choice.  But recently Patrick mentioned that the current G++ choice
    not to treat it as a "member declaration" was making his library work
    significantly more cumbersome, so let's go ahead and vote the other way.

    This means that the testcases for 100502 and 58993 are now accepted.

            DR1699
            PR c++/100502
            PR c++/58993

    gcc/cp/ChangeLog:

            * friend.cc (is_friend): Hidden friends count as members.
            * search.cc (friend_accessible_p): Likewise.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/access37.C: Now OK.
            * g++.dg/template/friend69.C: Now OK.
            * g++.dg/lookup/friend23.C: New test.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/58993] incorrectly accept access of protected member method from derived class template
  2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
                   ` (5 preceding siblings ...)
  2022-05-15 16:45 ` cvs-commit at gcc dot gnu.org
@ 2022-06-02 13:29 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-06-02 13:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |csaba_22 at yahoo dot co.uk

--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 105752 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-02 13:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04 23:52 [Bug c++/58993] New: failure to access pointer to protected member method in base from derived class specialization cvs at cs dot utoronto.ca
2013-11-05 11:59 ` [Bug c++/58993] incorrectly accept access of protected member method from derived class template redi at gcc dot gnu.org
2013-11-05 13:37 ` cvs at cs dot utoronto.ca
2021-01-12 16:58 ` ppalka at gcc dot gnu.org
2021-01-19 21:20 ` cvs-commit at gcc dot gnu.org
2021-01-20 14:52 ` ppalka at gcc dot gnu.org
2022-05-15 16:45 ` cvs-commit at gcc dot gnu.org
2022-06-02 13:29 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).