1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This is a "No Compile Test" suite.
6 // http://dev.chromium.org/developers/testing/no-compile-tests
8 #include "base/values.h"
14 void G(ValueView v) {}
16 #if defined(NCTEST_VALUE_CTOR_PTR_DOES_NOT_CONVERT_TO_BOOL) // [r"fatal error: call to deleted constructor"]
23 #elif defined(NCTEST_DICT_SET_PTR_DOES_NOT_CONVERT_TO_BOOL) // [r"fatal error: call to deleted member function"]
31 #elif defined(NCTEST_DICT_SETBYDOTTEDPATH_PTR_DOES_NOT_CONVERT_TO_BOOL) // [r"fatal error: call to deleted member function"]
36 dict.SetByDottedPath("moo.moo", ptr);
39 #elif defined(NCTEST_LIST_APPEND_PTR_DOES_NOT_CONVERT_TO_BOOL) // [r"fatal error: call to deleted member function"]
47 #elif defined(NCTEST_VALUE_CTOR_INT64_T) // [r"fatal error: ambiguous conversion for functional-style cast from 'int64_t' \(aka '.+?'\) to 'Value'"]
49 Value F(int64_t value) {
53 #elif defined(NCTEST_SET_INT64_T) // [r"fatal error: call to member function 'Set' is ambiguous"]
55 Value::Dict F(int64_t value) {
57 dict.Set("あいうえお", value);
61 #elif defined(NCTEST_SETBYDOTTEDPATH_INT64_T) // [r"fatal error: call to member function 'SetByDottedPath' is ambiguous"]
63 Value::Dict F(int64_t value) {
65 dict.SetByDottedPath("あいうえお", value);
69 #elif defined(NCTEST_LIST_APPEND_INT64_T) // [r"fatal error: call to member function 'Append' is ambiguous"]
71 Value::List F(int64_t value) {
77 #elif defined(NCTEST_VALUEVIEW_FROM_CONST_NON_CHAR_POINTER) // [r"fatal error: conversion function from 'const int \*' to 'ValueView' invokes a deleted function"]
80 const int* ptr = nullptr;
85 #elif defined(NCTEST_VALUEVIEW_FROM_NON_CHAR_POINTER) // [r"fatal error: conversion function from 'int \*' to 'ValueView' invokes a deleted function"]
93 #elif defined(NCTEST_VALUEVIEW_FROM_STRING_TEMPORARY) // [r"fatal error: object backing the pointer will be destroyed at the end of the full-expression"]
96 ValueView v = std::string();
100 #elif defined(NCTEST_VALUEVIEW_FROM_BLOB_TEMPORARY) // [r"fatal error: object backing the pointer will be destroyed at the end of the full-expression"]
103 ValueView v = Value::BlobStorage();
107 #elif defined(NCTEST_VALUEVIEW_FROM_DICT_TEMPORARY) // [r"fatal error: object backing the pointer will be destroyed at the end of the full-expression"]
110 ValueView v = Value::Dict();
114 #elif defined(NCTEST_VALUEVIEW_FROM_LIST_TEMPORARY) // [r"fatal error: object backing the pointer will be destroyed at the end of the full-expression"]
117 ValueView v = Value::List();
121 #elif defined(NCTEST_VALUEVIEW_FROM_VALUE_TEMPORARY) // [r"fatal error: object backing the pointer will be destroyed at the end of the full-expression"]
124 ValueView v = Value();