[Bug c++/71214] New: Typo in feature test macro for rvalue references

2016-05-20 Thread trprince at synopsys dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71214

Bug ID: 71214
   Summary: Typo in feature test macro for rvalue references
   Product: gcc
   Version: 4.9.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trprince at synopsys dot com
  Target Milestone: ---

According to P0096R2
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0096r2.html) the
feature test macro for C++11 rvalue references should be
'__cpp_rvalue_references'. However, GCC uses '__cpp_rvalue_reference' (note the
missing 's').

$ g++ -std=c++11 -dM -E -xc++ /dev/null | grep __cpp_rvalue
#define __cpp_rvalue_reference 200610
$ 

Clang and EDG both use the plural version:

$ clang++ -std=c++11 -dM -E -xc++ /dev/null | grep __cpp_rvalue
#define __cpp_rvalue_references 200610
$ edgcpfe-4.11 --c++11 --list_macros - < /dev/null | grep __cpp_rvalue
#define __cpp_rvalue_references 200610
$ 

I've tested and reproduced this behavior as far back as 4.9.2 which I believe
is around the time the feature test macros were originally introduced.

[Bug c++/108780] New: Spurious warning with -ftrivial-auto-var-init=zero

2023-02-13 Thread trprince at synopsys dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108780

Bug ID: 108780
   Summary: Spurious warning with -ftrivial-auto-var-init=zero
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trprince at synopsys dot com
  Target Milestone: ---

I encountered the following spurious (or at least, confusing/misleading--note
the variable name) warning on some code after enabling
`-ftrivial-auto-var-init=zero` on one of our codebases. It appears that there
have been similar issues with spurious warnings and
`-ftrivial-auto-var-init=zero` in the past but I was able to reproduce this
with trunk on godbolt:

https://godbolt.org/z/zre74sWq1

$ cat bad.cpp
struct a {
  int b();
};
void c() {
  a d;
  const auto &e(d.b());
}
$ g++ --version
g++ (GCC) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ -ftrivial-auto-var-init=zero -Wuninitialized -c bad.cpp
bad.cpp: In function ‘void c()’:
bad.cpp:6:22: warning: ‘D.2414’ is used uninitialized [-Wuninitialized]
6 |   const auto &e(d.b());
  |  ^
$

I'd be happy to provide any additional context if I'm missing anything.