[LLVMbugs] [Bug 17862] New: Support attribute deprecated for template alias

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 9 01:53:08 PST 2013


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

            Bug ID: 17862
           Summary: Support attribute deprecated for template alias
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: foss at grueninger.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I want to rename a templated class. To make the transition easier for the
users, I'd like to keep the old class for one more version and mark it
deprecated with the extensions from GCC / Clang (attribute deprecated). To
avoid keeping an exact copy of the deprecated class, the use of template alias
would be handy. Unfortunately Clang (3.3 and recent trunk) does not emit a
warning (GCC does) for the following code in line 14:

template <class T>
struct NewClassName
{
    // ...
};

template <class T> using OldClassNameUsing __attribute__ ((deprecated))
  = NewClassName<T>;

typedef NewClassName<int> OldClassNameTypedef __attribute__ ((deprecated));

int main()
{
  OldClassNameUsing<int> objectUsing;
  OldClassNameTypedef objectTypedef;

  return 0;
}



Clang used:
clang version 3.4 (194323)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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/20131109/37022073/attachment.html>


More information about the llvm-bugs mailing list