[Bug c++/70125] New: attributes diagnostics missing essential context

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 7 16:34:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70125

            Bug ID: 70125
           Summary: attributes diagnostics missing essential context
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Diagnostics for attributes are missing information that can be essential in
determining the root cause of the problem.  For example, the following test
case causes a warning pointing out that the attribute vector_size is ignored. 
But there is no indication as to which of the two invocations of the function
in which the attribute is used causes the diagnostic.  To help debug these
problems the diagnostic should include both the value of the vector_size
attribute and, for constexpr functions, the call stack.

$ cat x.c && /build/gcc-trunk-bootstrap/gcc/xg++ -B
/build/gcc-trunk-bootstrap/gcc -S -Wall -Wextra -Wpedantic -o/dev/null -xc++
x.c
constexpr int foo (unsigned N)
{
  typedef int V __attribute__ ((vector_size (N)));
  V v = 0;
  return v;
}

int i = foo (1);
int j = foo (16);
x.c: In function ‘constexpr int foo(unsigned int)’:
x.c:3:49: warning: ‘vector_size’ attribute ignored [-Wattributes]
   typedef int V __attribute__ ((vector_size (N)));
                                                 ^


More information about the Gcc-bugs mailing list