Use the new-initialization code for initializing scalars with a
function-style cast. Previously, we had a (redundant, incorrect)
semantic-checking path for non-class types, which allowed
value-initialization of a reference type and then crashed.
llvm-svn: 113415
diff --git a/clang/test/SemaCXX/functional-cast.cpp b/clang/test/SemaCXX/functional-cast.cpp
index 2f63c20..61e4da3 100644
--- a/clang/test/SemaCXX/functional-cast.cpp
+++ b/clang/test/SemaCXX/functional-cast.cpp
@@ -23,7 +23,7 @@
void test_cxx_function_cast_multi() {
(void)NoValueInit(0, 0);
(void)NoValueInit(0, 0, 0); // expected-error{{no matching constructor for initialization}}
- (void)int(1, 2); // expected-error{{function-style cast to a builtin type can only take one argument}}
+ (void)int(1, 2); // expected-error{{excess elements in scalar initializer}}
}
@@ -314,4 +314,7 @@
{
typedef itn Typo; // expected-error {{unknown type name 'itn'}}
(void)Typo(1); // used to crash
+
+ typedef int &int_ref;
+ (void)int_ref(); // expected-error {{reference to type 'int' requires an initializer}}
}