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

            Bug ID: 19558
           Summary: Partial specialization of variable template causes
                    'unused variable' warning illegally.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

I've found partial specialization of variable template causes 'unused variable'
warning illegally.  This issue does not occur when non-partial specialization.

// Test code
template<class T>
constexpr bool is_pointer = false;

template<class T>
constexpr bool is_pointer<T *> = true;

int main()
{
    (void) is_pointer<int *>;
    return 0;
}
// End of test code


Output:

prog.cc:5:16: warning: unused variable 'is_pointer' [-Wunused-const-variable]
constexpr bool is_pointer<T *> = true;
               ^
1 warning generated.



I expected no output.
I tested above code with clang 3.5 HEAD (trunk 206991).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to