Bug 31099 - Scope of function arguments type changed ?
Scope of function arguments type changed ?
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-08 16:34 EST by Olaf Flebbe
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-08 16:35:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Demonstration Code (208 bytes, text/plain)
2001-03-08 16:35 EST, Olaf Flebbe
no flags Details

  None (edit)
Description Olaf Flebbe 2001-03-08 16:34:43 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [de] (X11; U; Linux 2.4.1 i686)

The code at The Code at the url gets an error  when compiling 
IMHO gcc-2.96-69 is incorrect.

Workaround is to profix QObject with :: .

Reproducible: Always
Steps to Reproduce:
1. g++ a.cpp


Actual Results:  a.cpp: In method
(QObject *)':
a.cpp:1: `class QObject' is inaccessible
a.cpp:12: within this context

Expected Results:  It should compile

gcc-2.95.2 and SGI CC does compile it.
Comment 1 Olaf Flebbe 2001-03-08 16:35:34 EST
Created attachment 12131 [details]
Demonstration Code
Comment 2 Jakub Jelinek 2001-03-09 07:44:56 EST
It should not compile, it is not valid ISO C++ code.
he name QObject is injected into class QObject, so it becomes a
private member of class QSignal, hiding the global definition of QObject in
classes derived from QSignal.
Using ::QObject there is not a workaround, it is how it should have been coded.

Note You need to log in before you can comment on or make changes to this bug.