On 09.03.2012, at 14:04, Dimitry Andric wrote:

> On 2012-03-09 09:00, Richard Smith wrote:
>> Author: rsmith
>> Date: Fri Mar  9 02:00:36 2012
>> New Revision: 152392
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=152392&view=rev
>> Log:
>> Support for raw and template forms of numeric user-defined literals,
>> and lots of tidying up.
> ...
>> Added: cfe/trunk/test/CXX/lex/lex.literal/lex.ext/p2.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/lex/lex.literal/lex.ext/p2.cpp?rev=152392&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/CXX/lex/lex.literal/lex.ext/p2.cpp (added)
>> +++ cfe/trunk/test/CXX/lex/lex.literal/lex.ext/p2.cpp Fri Mar  9 02:00:36 
>> 2012
>> @@ -0,0 +1,16 @@
>> +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
>> +
>> +typedef decltype(sizeof(int)) size_t;
>> +
>> +// FIXME: These diagnostics should say 'size_t' instead of 'unsigned long'
>> +int a = 123_x; // expected-error {{no matching literal operator for call to 
>> 'operator "" _x' with argument of type 'unsigned long long' or 'const char 
>> *', and no matching literal operator template}}
>> +int b = 4.2_x; // expected-error {{no matching literal operator for call to 
>> 'operator "" _x' with argument of type 'long double' or 'const char *', and 
>> no matching literal operator template}}
>> +int c = "foo"_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with arguments of types 'const char *' and 'unsigned 
>> long'}}
>> +int d = L"foo"_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with arguments of types 'const wchar_t *' and 'unsigned 
>> long'}}
>> +int e = u8"foo"_x; // expected-error {{no matching literal operator for 
>> call to 'operator "" _x' with arguments of types 'const char *' and 
>> 'unsigned long'}}
>> +int f = u"foo"_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with arguments of types 'const char16_t *' and 'unsigned 
>> long'}}
>> +int g = U"foo"_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with arguments of types 'const char32_t *' and 'unsigned 
>> long'}}
>> +int h = 'y'_x; // expected-error {{no matching literal operator for call to 
>> 'operator "" _x' with argument of type 'char'}}
>> +int i = L'y'_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with argument of type 'wchar_t'}}
>> +int j = u'y'_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with argument of type 'char16_t'}}
>> +int k = U'y'_x; // expected-error {{no matching literal operator for call 
>> to 'operator "" _x' with argument of type 'char32_t'}}
> 
> This particular test fails on FreeBSD, but only on i386 (where size_t is 
> unsigned int), not amd64 (where size_t is unsigned long):

I committed a workaround in r152404.

- Ben

> 
> ******************** TEST 'Clang :: CXX/lex/lex.literal/lex.ext/p2.cpp' 
> FAILED ********************
> Script:
> --
> /home/dim/obj/llvm-152403-trunk-fbsd10-i386-rel-1/Release+Asserts/bin/clang 
> -cc1 -internal-isystem 
> /home/dim/obj/llvm-152403-trunk-fbsd10-i386-rel-1/Release+Asserts/bin/../lib/clang/3.1/include
>  -fsyntax-only -std=c++11 -verify 
> /share/dim/src/llvm/trunk/tools/clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp
> --
> Exit Code: 1
> Command Output (stderr):
> --
> error: 'error' diagnostics expected but not seen:
>  Line 8: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char *' and 'unsigned long'
>  Line 9: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const wchar_t *' and 'unsigned long'
>  Line 10: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char *' and 'unsigned long'
>  Line 11: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char16_t *' and 'unsigned long'
>  Line 12: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char32_t *' and 'unsigned long'
> error: 'error' diagnostics seen but not expected:
>  Line 8: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char *' and 'unsigned int'
>  Line 9: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const wchar_t *' and 'unsigned int'
>  Line 10: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char *' and 'unsigned int'
>  Line 11: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char16_t *' and 'unsigned int'
>  Line 12: no matching literal operator for call to 'operator "" _x' with 
> arguments of types 'const char32_t *' and 'unsigned int'
> 10 errors generated.
> --
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to