[Bug c++/61182] New: Forming pointer to qualified function type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61182 Bug ID: 61182 Summary: Forming pointer to qualified function type Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pdaou...@aldebaran-robotics.com Created attachment 32793 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32793&action=edit Minimal test The attached code does not compile on gcc 4.9 but compiles on clang 3.4 and gcc < 4.9. Accessor decompose the type with C = "C" and T = "int () const" in the first call of make. Then same_type creates a T* and removes the pointer to get back to the same type. GCC 4.9 complains that we cannot create a pointer to a qualified pointer type even though we never instanciate it.
[Bug c++/61182] Forming pointer to qualified function type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61182 --- Comment #3 from pdaou...@aldebaran-robotics.com --- I am no c++ expert but my guess is that it should be allowed to have qualified function types as long as you don't try to instantiate that type. The problem in our code is that we use boost::remove_const (which should be a noop in this case I believe) which uses a trick involving pointers similar to what I wrote in the attached example and does not compile with 4.9. Still, if the standard says that it is not allowed we can work around it, but then should I file a bug to clang?
[Bug c++/61182] [4.9/4.10 Regression] Forming pointer to qualified function type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61182 --- Comment #10 from pdaou...@aldebaran-robotics.com --- (In reply to Daniel Krügler from comment #9) > I don' think that this specialization can - according to the language - > remove const qualifiers of function types, because there is no > const-qualifier to remove. remove_const does not remove const from functions even in previous function of gcc and I do not expect it to do that. I expect it to give the same type, unchanged as it does with gcc < 4.9.