This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70125] New: attributes diagnostics missing essential context
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Mar 2016 16:34:34 +0000
- Subject: [Bug c++/70125] New: attributes diagnostics missing essential context
- Auto-submitted: auto-generated
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)));
^