public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45642]  New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved
@ 2010-09-10 17:33 tbptbp at gmail dot com
  2010-09-10 17:34 ` [Bug c++/45642] " tbptbp at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tbptbp at gmail dot com @ 2010-09-10 17:33 UTC (permalink / raw)
  To: gcc-bugs

Since around 2010/09/07 g++ started to barf on the attached source about a
mismatched prototype. Apparently the culprit is the forward declaration + later
definition with additional attribute of one of the argument, and, if the
forward declaration is sprinkled with said attribute, the error goes away.

I've failed to reduce both manually and with delta (mismatched prototypes are
too easily produced). Sorry.

$ /usr/local/gcc-4.6-20100910/bin/g++ -std=c++0x -c synth.ii
src/audio/synth_voice_impl.h:140:6: error: prototype for 'bool
synth::voice::voice_t::produce_chunk(const synth::semitones_lut_t&, const
synth::midi_channels_params_t&, synth::chunk_array_mono_t&)' does not match any
in class 'synth::voice::voice_t'
src/audio/synth_voice.h:153:156: error: candidate is:
template<synth::voice::waves::waves_enum_t wave_shape> bool
synth::voice::voice_t::produce_chunk(const synth::semitones_lut_t&, const
synth::midi_channels_params_t&, synth::chunk_array_mono_t&)
...
$ /usr/local/gcc-4.6-20100910/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-4.6-20100910/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.6-20100910/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-4.6.0
--enable-languages=c,c++ --enable-threads=posix --disable-checking
--disable-nls --with-system-zlib --disable-bootstrap --enable-checking=none
--enable-mpfr --enable-gold --enable-lto --with-ppl --with-cloog
--with-arch=native
Thread model: posix
gcc version 4.6.0 20100910 (experimental) (GCC) 

midi_channels_params_t is the trigger.
Known to work on g++ 4.4.x, 4.5.x and up to and including 4.6-20100901.

PS: http://gcc.gnu.org/ml/gcc/2010-09/msg00152.html


-- 
           Summary: g++ 4.6 regression, c++0x, weird mismatch for arguments
                    with forwarded declaration when attributes are involved
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbptbp at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/45642] g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved
  2010-09-10 17:33 [Bug c++/45642] New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved tbptbp at gmail dot com
@ 2010-09-10 17:34 ` tbptbp at gmail dot com
  2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tbptbp at gmail dot com @ 2010-09-10 17:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tbptbp at gmail dot com  2010-09-10 17:34 -------
Created an attachment (id=21767)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21767&action=view)
large & fugly testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/45642] g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved
  2010-09-10 17:33 [Bug c++/45642] New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved tbptbp at gmail dot com
  2010-09-10 17:34 ` [Bug c++/45642] " tbptbp at gmail dot com
  2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
@ 2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
  2010-09-10 18:00 ` tbptbp at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-10 17:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2010-09-10 17:35 -------
This seems related to PR 45112.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/45642] g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved
  2010-09-10 17:33 [Bug c++/45642] New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved tbptbp at gmail dot com
  2010-09-10 17:34 ` [Bug c++/45642] " tbptbp at gmail dot com
@ 2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
  2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
  2010-09-10 18:00 ` tbptbp at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-10 17:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-09-10 17:34 -------
I think you need __attribute((aligned(16))) on the original forward declared
class too.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/45642] g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved
  2010-09-10 17:33 [Bug c++/45642] New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved tbptbp at gmail dot com
                   ` (2 preceding siblings ...)
  2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
@ 2010-09-10 18:00 ` tbptbp at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tbptbp at gmail dot com @ 2010-09-10 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tbptbp at gmail dot com  2010-09-10 18:00 -------
(In reply to comment #2)
> I think you need __attribute((aligned(16))) on the original forward declared
> class too.
As stated that does, indeed, fix it.
So, ok, let's say previous versions were too permissive, then, the problem is
with the extremely confusing and useless diagnostic: there's no warning with
-Wall -Wextra about the declaration/definition mismatch, and a puzzling error
about an unrelated foo(x, y) not matching foo(x, y).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-10 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 17:33 [Bug c++/45642] New: g++ 4.6 regression, c++0x, weird mismatch for arguments with forwarded declaration when attributes are involved tbptbp at gmail dot com
2010-09-10 17:34 ` [Bug c++/45642] " tbptbp at gmail dot com
2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
2010-09-10 17:35 ` pinskia at gcc dot gnu dot org
2010-09-10 18:00 ` tbptbp at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).