[LLVMbugs] [Bug 8143] New: #pragma diagnostic ignored is not honoured by template code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 13 17:51:50 PDT 2010


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

           Summary: #pragma diagnostic ignored is not honoured by template
                    code
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: luc_j_bourhis at mac.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5488)
 --> (http://llvm.org/bugs/attachment.cgi?id=5488)
self-contained snippet reproducing the bug

~> clang --version
clang version 2.9 (trunk 113485)
Target: x86_64-apple-darwin10
Thread model: posix

~> make
clang++    -c -o main.o main.cpp
In file included from main.cpp:1:
./warning.hpp:6:9: warning: comparison of unsigned expression < 0 is always
false
      [-Wtautological-compare]
  if (x < T(0)) return -x;
      ~ ^ ~~~~
main.cpp:5:16: note: in instantiation of function template specialization
'absolute<unsigned int>'
      requested here
  std::cout << absolute(1u) << absolute_unsigned(1u) << std::endl;
               ^
1 warning generated.

Thus "#pragma diagnostic ignored" is actually ignored by templated code.

C.f. thread
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-September/010884.html

-- 
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.



More information about the llvm-bugs mailing list