[LLVMbugs] [Bug 22076] New: template attribute is not diagnosed in the first instantiation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 1 04:11:02 PST 2015


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

            Bug ID: 22076
           Summary: template attribute is not diagnosed in the first
                    instantiation
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: yaron.keren at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compile this code with clang r224899:


template <typename T>class c { T d; } __attribute__ ((__deprecated__));
int main() {
  c<int> a;
  c<int> b;
}


the __deprecated__ attribute is diagnosed for b but not for the first time it's
used in a. If b is removed there is no warning at all.

Debugging finds that DiagnoseAvailabilityOfDecl() in SemaExpr.cpp gets a
ClassTemplateSpecializationDecl declaration for a without any attributes but
ClassTemplateSpecializationDecl definition for b with deprecated attribute.

-- 
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/20150101/becb57b4/attachment.html>


More information about the llvm-bugs mailing list