seen with trunk 20100107 on ix86: $ g++ -c greg_month.ii In file included from ./boost/date_time/gregorian/formatters.hpp:17:0, from libs/date_time/src/gregorian/greg_month.cpp:21: ./boost/date_time/date_formatting.hpp: In static member function 'static std::basic_string<charT> boost::date_time::ymd_formatter<ymd_type, format_type, charT>::ymd_to_string(ymd_type)': ./boost/date_time/date_formatting.hpp:87:36: error: cannot call constructor 'std::locale::locale' directly ./boost/date_time/date_formatting.hpp:87:36: note: for a function-style cast, remove the redundant '::locale' ./boost/date_time/gregorian/formatters.hpp:65: confused by earlier errors, bailing out Preprocessed source stored into /tmp/ccNSCpcB.out file, please attach this to your bugreport.
Created attachment 19546 [details] preprocessed source
As usual, please reduce these beasts...
You can use -fpermissive in which case it's no longer error-recovery. The emitted warning doesn't vanish with -w, the note stays: > ./cc1plus -quiet greg_month.ii -m32 -fpermissive -w In file included from ./boost/date_time/gregorian/formatters.hpp:17:0, from libs/date_time/src/gregorian/greg_month.cpp:21: ./boost/date_time/date_formatting.hpp: In static member function 'static std::basic_string<charT> boost::date_time::ymd_formatter<ymd_type, format_type, charT>::ymd_to_string(ymd_type)': ./boost/date_time/date_formatting.hpp:87:36: note: for a function-style cast, remove the redundant '::locale' In file included from libs/date_time/src/gregorian/greg_month.cpp:21:0: ./boost/date_time/gregorian/formatters.hpp: In function 'std::basic_string<_CharT> boost::gregorian::to_iso_string_type(const boost::gregorian::date_period&) [with charT = char, boost::gregorian::date_period = boost::date_time::period<boost::gregorian::date, boost::gregorian::date_duration>]': ./boost/date_time/gregorian/formatters.hpp:72:38: instantiated from here ./boost/date_time/gregorian/formatters.hpp:65:125: internal compiler error: in tsubst_copy, at cp/pt.c:10664 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Reducing.
Created attachment 19549 [details] reduced testcase
The code warning: 155347 jason user_args = args == NULL ? NULL : *args; 155347 jason /* Under DR 147 A::A() is an invalid constructor call, 155347 jason not a functional cast. */ 155347 jason if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)) 155347 jason { 155347 jason if (! (complain & tf_error)) 155347 jason return error_mark_node; 155347 jason 155347 jason permerror (input_location, 155347 jason "cannot call constructor %<%T::%D%> directly", 155347 jason basetype, name); 155347 jason inform (input_location, "for a function-style cast, remove the " 155347 jason "redundant %<::%D%>", name); 155347 jason call = build_functional_cast (basetype, build_tree_list_vec (user_args), 155347 jason complain); 155347 jason release_tree_vector (user_args); 155347 jason return call; 155347 jason } To avoid the spurious note, the code should use the idiom permerror() && inform(), since diagnostics functions that may be suppressed return false if they don't print anything.
This is caused by revision 155347: http://gcc.gnu.org/ml/gcc-cvs/2009-12/msg00491.html
*** Bug 42725 has been marked as a duplicate of this bug. ***
Reduced testcase from PR42725: namespace Glib { class ustring { public: typedef unsigned size_type; ustring(const char* src, size_type n); ustring(const char* src); }; } namespace Gdk { class Color { public: explicit Color(const Glib::ustring& value); }; } namespace Gtk { enum StateType { STATE_NORMAL }; class Widget { public: void modify_bg(StateType state, const Gdk::Color& color); }; class Label { public: void set_text(const Glib::ustring &str); }; } typedef enum Result { eSuccess = 0 } Result; class MainWindow { void update_status(Result result); Gtk::Widget status_frame; Gtk::Label status_label; }; void MainWindow::update_status(Result result) { switch (result) { status_frame.modify_bg(Gtk::STATE_NORMAL,Gdk::Color::Color("green")); status_frame.modify_bg(Gtk::STATE_NORMAL,Gdk::Color::Color("red")); status_label.set_text("Out of memory"); } }
Subject: Bug 42701 Author: jason Date: Thu Jan 14 22:32:24 2010 New Revision: 155916 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155916 Log: PR c++/42701 * call.c (build_new_method_call): Don't free the vec here. Added: trunk/gcc/testsuite/g++.dg/overload/error3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog
Fixed.
*** Bug 42569 has been marked as a duplicate of this bug. ***