[LLVMbugs] [Bug 14298] Incorrect processing of private inheritance

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 8 03:48:19 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=14298

Ismail Pazarbasi <ismail.pazarbasi at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ismail.pazarbasi at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from Ismail Pazarbasi <ismail.pazarbasi at gmail.com> ---
Clang handles this case correctly.

class_2 injected class name will be inherited by class_1 as well, but it will
be a private member in class_1 (and, hence, in class_0). In the declaration of
var_4, class_2 refers to this privately inherited injected class name. Class
scope will be looked up first, and a name will be found, but it will not be
accessible. 

Use fully qualified name for class_2 to refer to class name in global
namespace.

struct class_0 : private class_1 {
  struct ::class_2 var_4; // OK
};

The error message, however, could be improved. In this particular case, class_2
name is actually not a private member of class_2, but it's a private member in
class_1 because class_1 privately inherits names from class_2. Injected class
names are public members of classes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130208/ec19d877/attachment.html>


More information about the llvm-bugs mailing list