[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 7267] New: Using private types should be allowed as
From:       bugzilla-daemon () llvm ! org
Date:       2010-05-31 10:18:12
Message-ID: bug-7267-206 () http ! llvm ! org/bugs/
[Download RAW message or body]

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

           Summary: Using private types should be allowed as template
                    parametter for explicit instantiation
           Product: clang
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs@nondot.org
        ReportedBy: ogoffart@kde.org
                CC: llvmbugs@cs.uiuc.edu, dgregor@apple.com


class Foo { class Bar1 {}; class Bar2{}; };
template<class T> struct Test {};
template struct Test<Foo::Bar1>; //#1 explicit instantiation
template<> struct Test<Foo::Bar2> {}; //#2 template specialization

/*
test.cpp:4:27: error: 'Bar1' is a private member of 'Foo'
template struct Test<Foo::Bar1>; //#1 explicit instantiation
                          ^
test.cpp:5:29: error: 'Bar2' is a private member of 'Foo'                       
template<> struct Test<Foo::Bar2> {}; //#2 template specialization
                            ^
*/


GCC compiles this code fine.

According to the standard: 14.7.2 [temp.explicit]  §8: "The usual access
checking rules do not apply to names used to specify explicit instantiations.
[Note: In particular, the template arguments and names used in the function
declarator (including parameter types, return types and exception
specifications) may be private types or objects which would normally not be
accessible and the template may be a member template or member function which
would not normally be accessible.]"

This seems to cover case #1.
I'm mostly interested in case #2, which cause compilation failure in Qt
(Linguist)
even if I have not found an explicit say that this should be allowed.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic